D
D
Dmitry Ivanov2016-11-07 13:29:14
Angular
Dmitry Ivanov, 2016-11-07 13:29:14

How to reuse ng-controller as singleton?

Each time the ng-controller directive is used, a new controller instance is created.
Is it possible to make such a controller a singleton? If so, how?
PS: The option to transfer the directive to one of the parent elements is not feasible in my case.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2016-11-07
@IDma88

For this factory are invented. Use at least 50 instances of the controller, and store the data in one place.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question