Categories

Jan 15 in Angular

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

1 Answer

Jan 15

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

Madanswer
Jan 6 in Angular
Oct 27 in JAVA
Nov 25, 2019 in SOAPUI
...