What is difference between factory service and provider in angularjs?
Answer / Jitendra Verma
In AngularJS, both Factory and Provider are used for dependency injection but they differ in how they create instances of the services. n- Factory is a function that returns an object. It is called every time when the dependency is requested.n- Provider on the other hand is an object that can be configured before it is used to create a service instance.n- By default, a provider creates a new instance every time a service is needed. However, if you want to have one shared instance of a service across your application, you should use $provide.value() or $provide.service().
| Is This Answer Correct ? | 0 Yes | 0 No |
What is deep linking in angular 2?
What is @injectable providedin root?
What are the ways to track the error in angularjs?
What is tap in angular?
Explain validations done in angularjs?
Is rxjs the same as react?
What is routerlinkactive in angular?
What is ngstyle and ngclass?
What is routing and navigation in angular?
How to create a service in angularjs?
Explain directives? What are inbuilt directives available in angularjs?
What is the bootstrapping in AngularJS?