Last active
January 22, 2018 13:41
-
-
Save frnkst/def24bd667117b027c9d855af02aae13 to your computer and use it in GitHub Desktop.
Angular service from developer console
This file contains 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
// Replace $window with any other injected service | |
var win = angular.element(document.querySelector('html')).injector().get('$window'); | |
// Or access the scope over a DOM element (fix .the-css-class and ctrlName. Maybe $parent is not needed either | |
var a = angular.element('.the-css-class').scope().$parent.ctrlName; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment