Last active
April 30, 2016 23:27
-
-
Save selfish/9e55ad3832e2067056d8 to your computer and use it in GitHub Desktop.
Angular Debugging via console; Import angular service / $rootScope to 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
| // Use Angular service in console: | |
| // clientDetails service (get method): | |
| angular.element(document.body).injector().get('clientDetails').get(); | |
| // configAPI service (set method): | |
| angular.element(document.body).injector().get('configAPI').set(); | |
| // Also works with var: | |
| var configAPIService = angular.element(document.body).injector().get('configAPI'); | |
| configAPIService.set(); | |
| // View $rootScope in console: | |
| var rootScope = angular.element('body').injector().get('$rootScope'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment