Hi Lokesh,
I updated your retrive function to this:
function retrive(callback) {
var url = 'test.json';
var params = {
callback: 'angular.callbacks._0',
};
return $http
.jsonp(url , {params:params}) // added a dynamic version
string to do cachebusting.
.then(response => response.data) // I'm only interseted in
the data part of the response
.then(callback)
.catch(err => console.log(err)); // added a error callback,
so you know whats happening.
}
This makes clear that your problem is with retreiving the data. Not the
actual fuction, as that is called every time. But without an error
handling, you never know. So it seems to be a problem with jsonp.
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.