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 route params?
What is data binding angular?
What is the use of pipe in angular?
Is react faster than angular?
What is a controller angular?
What is isolate scope in angularjs?
Please explain unit testing in angular?
Is react a framework?
What is zones in angular 2?
What is traceur compiler? Why in angular 2?
What are the features of angular 2 service?
What is the difference between ng model and ng bind?
What is innerhtml in angular?
How can you get url parameters from angularjs controller?
What is autofilter in excel?