What is the difference between angular service and factory?
Answer / Gurav Kumar
Both services and factories in AngularJS are used to organize code, manage dependencies, and provide shared functionality across different parts of an application. The main difference lies in how they create their instances. A factory creates a new instance every time it is called, while a service reuses the same instance as long as the application lives.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the advantages of angular 2 ?
How will you convert a string into a percentage?
How did you stop observable?
What do you understand by $watch?
How routing works in angular 2.?
What is angular promise?
How to preventdefault on anchor tags?
How does the dom work?
What are the differences between service and factory methods?
How can you use “$rootscope” in angularjs?
What are the differences between $resource and $http?
Explain Authentication and Authorization?