javascript - Is using singleton pattern in angularjs a bad practise? -


i have been coding in angular js while now. friend of mine suggested me not use singleton pattern in angularjs, bad practise. totally unaware of that. so?

no, because services singletons design. quote docs:

note: services in angular singletons. means injector uses each recipe @ once create object. injector caches reference future needs.

source: angular docs


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -