// this is service where i m calling api
app.factory('users',['$http','$q', function($http , $q) {
\t
return {
\t getUsers: function() {
\t \t var deferred = $q.defer();
\t \t var url = 'http://www.geognos.com/api/en/countries/info/all.jsonp?callback=JSONP_CALLBACK';
\t \t
\t \t $http.jsonp(url).success(function (data, status, headers, config) {
\t \t \t console.log(data);
\t \t \t deferred.resolve(data);
\t \t }).
\t error(function (data, status, headers, config) {
//this always gets called
console.log(status);
deferred.reject(status);
});
return deferred.promise;
}
}
}]);
//this is my controller where i calling getUsers();
app.controller('myCtrl', function($scope, users) {
$scope.data = users.getUsers();
})
에 $의 HTTP를 사용하여 API를 JSONP 호출하는 방법을 나
Uncaught ReferenceError: callback is not defined(anonymous function)
Plz은 나에게 적절한 솔루션을 제공 오류 . 사전에 감사드립니다