Skip to content

Instantly share code, notes, and snippets.

@dmk1111
Last active April 24, 2018 11:28
Show Gist options
  • Select an option

  • Save dmk1111/cffdf8380d590149f17b06b45961745a to your computer and use it in GitHub Desktop.

Select an option

Save dmk1111/cffdf8380d590149f17b06b45961745a to your computer and use it in GitHub Desktop.
get angular service from console
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