What is the difference between Factory, Service and Provider?
Answer Posted / 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 |
Post New Answer View All Answers
What is root injector in angular?
Explain expressions in angularjs?
What is $ digest?
What is modules?
Name the types of linking function?
How to implement http cache using interceptors in angular 4?
What is a provider in angularjs?
What should be the maximum number of concurrent “watches” ?
What is event binding in angular?
What are events in angular?
Explain what string interpolation is in angularjs?
What is injector?
What is the difference between a unit and end-to-end (e2e) test in angularjs?
What is dom manipulation in angular?
Which is better angular material or bootstrap?