Last active
April 24, 2018 11:28
-
-
Save dmk1111/cffdf8380d590149f17b06b45961745a to your computer and use it in GitHub Desktop.
get angular service from 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
| var injector = angular.element(document.querySelector('*[ng-app]')).injector(); | |
| var myService = injector.get("myService"); | |
| // You can call service methods from console now | |
| //info taken this question: from https://stackoverflow.com/questions/15527832/how-can-i-test-an-angularjs-service-from-the-console |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment