What is a singleton pattern and where we can find it in angular?
Answer / Shiv Mohan Singh
The Singleton pattern is a design pattern that restricts the instantiation of a class to a single instance. In Angular, you can implement the Singleton pattern using the built-in services.nFor example, when you inject the $http service into your component or directive, it ensures only one instance of the $http service will be created and shared across all components and directives in your application.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is constant?
What is the purpose of tsconfig.json in angularjs?
Is angular 7 is stable?
What is singleton object?
Explain ng-model directive?
What is the bootstrapping in AngularJS?
What are directives? How to create and use custom directive in angularjs.
What is testability like in angular?
What is the difference between angular 4 and angular 7?
What are observables in angular?
What are the components of a css style?
When to use factory?