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
Please explain system.config.ts file used in angular?
Explain the architecture of angular 2?
What is mean stack development?
How to use $scope.$Watch and $scope.$Apply in angularjs?
What is directives in angular 2?
Define ng-if, ng-show and ng-hide.
How does angular use singleton pattern?
Explain ng-hide directive?
What is filter in angularjs?
Can I use angularjs with php?
What are @injectable providers?
What is controller in angular?
What is the use of ng dblclick?
What is angular router and router module?
In how many ways the Data Binding can be done?