When to use factory?
Answer / Ashish Gotra
Factories in AngularJS are used to create new services, and they can be used when you need to return an object or a function. They are useful when you need more control over the instantiation process compared to services. For example, if you have a complex service that requires multiple dependencies, a factory can be used to configure these dependencies.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain call and apply method?
What is ivy rendering engine in angular 7?
What are inbuilt directives available in angularjs?
What is the main purpose of $routeprovider in angularjs?
Which database is best for angularjs?
what is di (dependency injection)?
Write the cli command to generate a component in angular 4?
Why do we need provider aliases? And how do you create one?
What is a selector?
What is pure and impure pipes? When to use pure and impure pipes?
What are the modules in angularjs?
Is angular 7 a framework?