Skip to content

Instantly share code, notes, and snippets.

@youngzhao-xyz
Last active May 18, 2018 22:19
Show Gist options
  • Save youngzhao-xyz/19ac25811b077202b0bb9bd05891c9a9 to your computer and use it in GitHub Desktop.
Save youngzhao-xyz/19ac25811b077202b0bb9bd05891c9a9 to your computer and use it in GitHub Desktop.

Angular 1.4 bindToController

Unit test

test an AngularJS service from the console

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

For example to get all app states

angular.element(document.body).injector().get('$state').get()

https://stackoverflow.com/a/15536532/2259286 https://stackoverflow.com/a/26465055/2259286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment