AngularJS Services Part 3: Service

So, Service is basically the same as Factory, it just has one key difference. Service treats the function as a constructor, meaning, the service will call new on the function and return the resulting object as a service object. Oh, if you haven’t yet read about Factory, check out AngularJS Services Part 2: Factory. Using Service Declaring a Service is easy. Lets look at an example. 1 2 3 4 5 6 7 8 9 10 (function(){ angular....

February 28, 2015 · 3 min · Ilija