Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
31
rated 0 times [  38] [ 7]  / answers: 1 / hits: 40414  / 12 Years ago, thu, november 1, 2012, 12:00:00

Is there a way of debugging the angularjs application when it is loaded in the browser?



ie. I wish to get the $rootScope of my current application. How would I do that?


More From » angularjs

 Answers
6

+1 for Batarang



Also, you can get the scope from any element in the DOM by executing the following from the console



angular.element(DOMNODE).scope()


Where DOMNODE, is of course, a reference to a DOM node.



For example, in Chrome in the elements tab you can select the node where the ng-app directive is, and get the root scope with



angular.element($0).scope()

[#82258] Tuesday, October 30, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
taliac

Total Points: 84
Total Questions: 114
Total Answers: 114

Location: Morocco
Member since Fri, May 22, 2020
4 Years ago
taliac questions
Sun, Mar 21, 21, 00:00, 3 Years ago
Tue, May 12, 20, 00:00, 4 Years ago
Mon, Jan 13, 20, 00:00, 4 Years ago
;