What is a singleton pattern and where we can find it in angular?



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

Post New Answer

More AngularJS Interview Questions

What is constant?

1 Answers  


What is the purpose of tsconfig.json in angularjs?

1 Answers  


Is angular 7 is stable?

1 Answers  


What is singleton object?

1 Answers  


Explain ng-model directive?

1 Answers  


What is the bootstrapping in AngularJS?

1 Answers  


What are directives? How to create and use custom directive in angularjs.

1 Answers  


What is testability like in angular?

1 Answers  


What is the difference between angular 4 and angular 7?

1 Answers  


What are observables in angular?

1 Answers  


What are the components of a css style?

1 Answers  


When to use factory?

1 Answers  


Categories