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 are the types of linking function?
What is the use of systems? How is webpack better to use in angular?
What is the use of @Input and @Output?
Explain routeprovider in angularjs?
What is autofilter in excel?
What is ngmodule decorator?
What is components in angular?
What is rx observable?
Difference between var, let, const?
how to generate a module in angular?
What is the use of @viewchild?
Angularjs dependency injection of value inside of the module.config?