$http inside a custom directive not working in 1.1.5 but working in 1.0.7 jsfiddle attached
1.1.5 >> http://jsfiddle.net/GwK9C/1/ 1.0.7 >> http://jsfiddle.net/GwK9C/2/
Any suggestions? Thanks
:+1:
var User = $resource('/user/:userId', {userId:'@id'});
User.save({param: value});
save every second time (sent first and second requests at the same time) if values were different and save after any other action (user.$save() f.e.) if values were identical. Queries arbitrarily added to any queue.
@phillycoder 1.1.x branch introduces promise-based request interceptors for $http and as a result now $http request must be triggered from within $digest loop. In short - you need to wrap your $http call into $apply the same way as you would do for other operations that need to kick off AngularJS-specific processing.
Here is a working jsFiddle: http://jsfiddle.net/PSMKN/1/
@pkozlowski-opensource thanks a lot, one question, is this only when i use $http inside directive? because my $http.get calls works fine in a controller.
Thanks again!!