Science, asked by lokeshdot5649, 1 year ago

What is the difference between Factory and Service Angular JS?

Answers

Answered by rishav200349
0
Factory:
Factory is mostly preferable in all cases. It can be used when you have constructor function which needs to be instantiated indifferent controllers. Service is a kind of Singleton Object. The Object return fromService will be same for all controller.

2. Angular JS
In AngularJS, services are reusable singleton objects that are used to organize and share code across your app. They can be injected into controllers, filters, directives. AngularJS provides you three ways : service, factory and provider to create a service."
Similar questions