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 |
On what steps for the compilation process of html happens?
What is spa in angularjs?
What are the purpose of @ngmodule?
What is a module and what does it contain?
How many times ngoninit is called?
How to share information between controllers in AngularJS?
What is called in angular?
Is react backend or frontend?
Which is the best backend technology for angular?
Explain routeprovider in angularjs?
How do you use singleton pattern?
How AngularJS expressions are different from the JavaScript expressions?