Explain the difference between angular service and factory? Explain
S.no | Angular service | Factory |
---|---|---|
1. | Angular service is a function dedicated to the business layer of the application. It worked as a constructor function and invoked at runtime with new. Public methods can be added to it. | The factory is a design pattern to create objects, return functions and closures, return Object literals, return a simply String and more. |
BY Best Interview Question ON 24 Feb 2020