I used the flickr photo search method to get public photos. when I run it with jquery it works fine, I get the json object in the correct form.
{ "photos": { "photo": [ { ......... } ] }, "stat": "ok" }
But when I use it with AngularJs, I got the same object with the jsonFlickrApi prefix
jsonFlickrApi({ "photos": { "photo": [ { ...... } ] }, "stat": "ok" })
what I used in AngularJs:
myApp.service('dataService', function($http) { delete $http.defaults.headers.common['X-Requested-With']; this.flickrPhotoSearch = function() { return $http({ method: 'GET', url: 'https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=3f807259749363aaa29c2fa93945&tags=india&format=json&callback=?', dataType: 'json' }); } });
Please tell me how I can convert the second JSON to the first. Is there anything I can do in the $http call or modify the JSON object.
json javascript jquery angularjs flickr
ankitr
source share