AngularJS: Accessing provider instances via the console
Ever want to get an instance of a service for debugging purposes in the console?
To do so you can access the injector that is available on a jQuery wrapped element and then get an instance of the service you want to look at.
For example to get an instance of the $q service you can do:
q = $('body').injector().get('$q);
You can than access any of the methods available on the $q service.
Written by Joe Grund
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Angularjs
Authors
Did you know?
AngularJS pages are long-lived browser apps with the same script risk as a newer single-page app. Third-party code in the template can read forms and values rendered on the page.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#