0
$ 리소스를 잘못 사용하고 있습니다 (대개는 오늘 각도로 시작한 것 같습니다). 또는 JSON이 잘못되었습니다.AngularJS가 유효한 JSON을 파싱하지 않습니다.
AngularJS와 바이올린 : http://jsfiddle.net/8zVxH/1/ 및 관련 코드 :
angular.module('app', ['ngResource']);
function AppCtrl($scope, $resource) {
var url = 'http:,,api.petfinder.com,pet.getRandom;key=260f9e3a6f6670b5d9db68b281ebe7a9;format=json;location=51503';
$scope.petfinder = $resource('http://jsonproxy.aws.af.cm/proxy/:action',
{action:url, callback:'JSON_CALLBACK'},
{get: {method:'JSONP'}});
$scope.indexResult = $scope.petfinder.get();
}
jQuery를 바이올린 : http://jsfiddle.net/78Cab/ 및 관련 코드 JQuery와 바이올린이 같은 URL을 치는 동작
$.ajax({
url: 'http://jsonproxy.aws.af.cm/proxy/http:,,api.petfinder.com,pet.getRandom;key=260f9e3a6f6670b5d9db68b281ebe7a9;format=json;location=51503',
method: 'GET'
}).done(function (data) {
console.log(data);
});
..
이 JSON을 명중 http://jsonproxy.aws.af.cm/proxy/http:,,api.petfinder.com,pet.getRandom;key=260f9e3a6f6670b5d9db68b281ebe7a9;format=json;location=51503은 http://jsonlint.com/을 유효한 JSON으로 전달합니다다른 사람이 비슷한 문제가 있습니까?