What is the difference between Factory, Service and Provider?
Answer / chaitanya
Factory - A factory is a simple function which allows you to add some logic before creating the object. It returns the created object.
Service - A service is a constructor function which creates the object using new keyword. You can add properties and functions to a service object by using this keyword. Unlike factory, it doesn’t return anything.
Provider - A provider is used to create a configurable service object. It returns value by using $get() function.
| Is This Answer Correct ? | 0 Yes | 0 No |
What do you understand by a template variable? How is it used?
Why to use AngularJS?
Is mvc front end or backend?
What is difference between factory and service?
Is angular 4 a framework?
If your data model is updated outside the ‘zone’, explain the process how will you the view?
Why do we use angular material?
How to implement internationalization in angular js?
Can we create our own directives?
What are the different types of filters in angular?
What is $locale service?
What is the difference between `{'ngfor'}` and `{`ngforof`}` in angular 2?