adspace
What is the difference between factory and service in angularjs?
Answer Posted / Dilbagh Singh
Factory and Service are both used for dependency injection in AngularJS, but they differ in their usage. A factory returns a new object each time it is invoked, while a service returns a singleton instance (a single instance shared across the entire application). Factory can be useful when you need to create complex objects that require multiple functions or properties.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to create angularjs filter which outputs html?
How to enable html5 mode in angular 1.x?
Angularjs dependency injection of value inside of the module.config?
How to use primeng in angular 4?
What is the latest version of angular?
What is the latest angular?
How to get and log an error in angular 4?
How an object or function can get a hold of its dependencies?
What is a dynamic route in angularjs and how do you implement it?
How to implement a datagrid table with angular 2 and primeng?
Give the example of angularjs strings?
Which version you are using js?
How can primeng be used with angular2?