What is the difference between factory and service in angularjs?
Answer / 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 |
What is typings in angular 2?
How to setup and install ionic framework with angular 4?
What is AOT Compilation?
What is the difference between angular 1(angularjs) and angular?
What are the advantages of AngularJS?
What is a selector?
What is the difference between link and compile in angular.js?
What is the factory method in angularjs?
What is an interface in angular?
What is compile function in angularjs?
What is a service angular?
Explain the difference between angular and angularjs?