angularjs jsonp回调错误 [英] angularjs jsonp callback error
问题描述
var student = angular.module(studentModule,[]);
student.controller(StudentCtrl,[$ scope,$ http,函数($ scope,$ http){
$ http({
方法:'jsonp',
url:'http://abelski.com/courses/ajax/data.json?callback=updateData'
})
.success(函数(数据,状态,标题,配置){
$ scope.students = data;
})
.error(函数(数据,状态,标题,配置){
});
}]);
scope,
< br>
http,函数(
scope,
guy below i given my code sample it's returning (Uncaught ReferenceError: updateData is not defined) error . could you help me to find what i am missing , pls help me to make it workable . here you can find code , my service returning JSONP response .
var student = angular.module("studentModule", []);
student.controller("StudentCtrl", ["$scope", "$http", function($scope, $http) {
$http({
method: 'jsonp',
url: 'http://abelski.com/courses/ajax/data.json?callback=updateData'
})
.success(function (data, status, headers, config) {
$scope.students = data;
})
.error(function (data, status, headers, config) {
});
}]);
scope", "
http", function(
scope,
这篇关于angularjs jsonp回调错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!