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 |
Why we use routing in angularjs?
What is forgiving in angularjs?
Does bootstrap require jquery?
When will nginit be called? How would you make use of ngoninit()?
Who made redux?
How is shadow dom helping angular 2 to perform better?
What is angular @ routeparams?
What is local reference in angular?
What is single page application (spa)?
What is the bootstrapping in AngularJS?
What is dependency injection in angular?
What is the difference between `{'ngfor'}` and `{`ngforof`}` in angular 2?