For last 1 day, I am trying to get clear understanding:-
- What is Service in angular
- Different ways of creating service
- Service vs Factory
Posted a question as well, which was marked duplicate & closed.
When should I use factory or service in angular?
But I am surprised to see that, on the angularjs official site,
https://docs.angularjs.org/guide/services
they have mentioned only
factory('factoryName', ['$window', function(win) {}])
Can someone please tell me why so?
Is Factory only the recommended way of creating service by Angular?