Jan 15, 2020 in Angular
Q: What is a singleton pattern and where we can find it in Angular?

1 Answer

0 votes
Jan 15, 2020

Singleton pattern in Angular is a great pattern which restricts a class from being used more than once. Singleton pattern in Angular is majorly implemented on dependency injection and in the services. Thus, if you use ‘new Object()’ without making it a singleton, then two different memory locations will be allocated for the same object. Whereas, if the object is declared as a singleton, in case it already exists in the memory then simply it will be reused.

Click here to read more about Angular JS
Click here to read more about Insurance

Related questions

0 votes
Feb 5 in Angular
...