4 ms·
I think it's miss-using the service in this example. The example should be using factory: .factory('RemoteResource', function($http){ return {retrieve: function
by keda 12y ago
I think it's miss-using the service in this example.
The example should be using factory:
.factory('RemoteResource', function($http){
return {retrieve: function(){ $http.get("url"); }}
})
Service should be like this:
.service('RemoteResource', function($http){
this.retrieve = function(){ $http.get("url"); }
})
See Stackoverflow:
http://stackoverflow.com/questions/15666048/angular-js-service-vs-provider-vs-factory http://stackoverflow.com/questions/15666048/angular-js-servi...