Javascript 无法读取属性';获取';在本地主机上打开时的未定义值
我是AngularJS的新手,我犯了那个错误Javascript 无法读取属性';获取';在本地主机上打开时的未定义值,javascript,angularjs,Javascript,Angularjs,我是AngularJS的新手,我犯了那个错误 ,app.controller("prjNewData", ["$scope", function($scope,$http) { $http.get('http://server/mndrest/index.php/api/example/taskpriority'). then(function(response){ $scope.taskpriority = response.data; })
,app.controller("prjNewData", ["$scope", function($scope,$http) {
$http.get('http://server/mndrest/index.php/api/example/taskpriority').
then(function(response){
$scope.taskpriority = response.data;
})
}]);
换药
["$scope", function($scope,$http) {
到
[“$scope”,
=>[“$scope”,“$http”,
您只是将“$scope”
注入控制器,请尝试:[“$scope”,“$http”,函数($scope,$http)
["$scope", "$http", function($scope,$http) {