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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -