学习Angular的Http时总是遇到$http.get(...).success is not a function的报错。非常简短的代码:angular.module('myApp',[])
.controller('C1', function ($scope, $http) {
$http.get("data/data.php")
.success(function () {
console.log('链接成功!');
});
});控制台提示:angular.min.js:122TypeError: $http.get(...).success is not a function
at new <anonymous> (02.html:32)
at Object.invoke (angular.min.js:43)
at R.instance (angular.min.js:93)
at n (angular.min.js:68)
at g (angular.min.js:60)
at g (angular.min.js:61)
at angular.min.js:60
at angular.min.js:21
at m.$eval (angular.min.js:147)
at m.$apply (angular.min.js:148)data.php只是一个JSON文件,希望得到大神们的帮助。:)
添加回答
举报
0/150
提交
取消