What is singleton in angular?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Works at the International Energy Agency, Lives in Paris, France.
A service is registered using the service() function of angular.module() . The second argument to service() is a constructor function. When we ask for the service as a dependency, AngularJS creates an object from this constructor function and injects it. A service is a singleton.
2023-05-11 04:44:23
评论(499)
Helpful(122)
Helpful
Helpful(2)

Daniel Rodriguez
QuesHub.com delivers expert answers and knowledge to you.
A service is registered using the service() function of angular.module() . The second argument to service() is a constructor function. When we ask for the service as a dependency, AngularJS creates an object from this constructor function and injects it. A service is a singleton.