Armin kheirkhahan
Armin kheirkhahan

Reputation: 291

How to get all of the instantiated controllers in angular js

I have an angularjs application, and I want to be able to get the list of all instantiated controllers in a given moment in Developer Tools console.

How can I do that?

I can't find either of these:

angular.controllers
angular.module('app').controllers

Non of these lines exist

Upvotes: 2

Views: 180

Answers (1)

Sachila Ranawaka
Sachila Ranawaka

Reputation: 41447

i think you can accomplish this by using _invokeQueue

angular.module('app')['_invokeQueue'].forEach(function(val) {
    console.log(val[2][0])
})

Upvotes: 2

Related Questions