Created
July 1, 2014 16:11
-
-
Save OzieWest/87010684d392c2c8470b to your computer and use it in GitHub Desktop.
Debugging AngularJS Apps from the Console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1: Access Scopes | |
| angular.element(targetNode).scope() | |
| // ChildScope {$id: "005", this: ChildScope, $$listeners: Object, $$listenerCount: Object, $parent: Scope…} | |
| angular.element(targetNode).isolateScope() | |
| // Scope {$id: "009", $$childTail: ChildScope, $$childHead: ChildScope, $$prevSibling: ChildScope, $$nextSibling: Scope…} | |
| 2: Grab any Services | |
| angular.element('html').injector().get('MyService') | |
| // Object {undo: function, redo: function, _pushAction: function, newDocument: function, init: function…} | |
| 3: Access controller for directive | |
| angular.element('my-pages').controller() | |
| // Constructor {} | |
| 4: Chrome Console Features | |
| angular.element($0).scope() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment