You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whatever you have explained on your website ( service vs factory vs provider) is best . Still i have one issue.
I have created object inside the angular.module('name',[]).service() and return the object in that service. still my code is working. Usually we are creating an object in factory and returning that object. but for service i have try to do same thing. still it is working.
I understand concept of new() and this of service and returning of object for factory. Both support scoping.
So,
i am confused why we have factory and service both ? both are doing the same thing.
What advantages will i get when i use factory or service ? Does factory have any advantage over service or service have on factory? or both are just the way to create Angular Services.
I have searched on internet read answers but not able to find the concrete answer. if you guys can explain it will be good.
Here is the JSFiddle Code i have created. You can go there and run the code.
confusion between Service and Factory.
Whatever you have explained on your website ( service vs factory vs provider) is best . Still i have one issue.
I have searched on internet read answers but not able to find the concrete answer. if you guys can explain it will be good.
Here is the JSFiddle Code i have created. You can go there and run the code.
Demo Angular Service vs Factory
The text was updated successfully, but these errors were encountered: