angular access service in console 1

angular access service in console

angular.element(document.body).injector().get('serviceName')

Here is what the above code is Doing:
1. Get the body element
2. Get the injector from the body element
3. Get the service from the injector

Similar Posts