search

Home  >  Q&A  >  body text

angular.js - What services should be obtained using angular.injector in angular JS? Is it the service in the official documentation?

Inputting angular.injector().get('$scope') directly in the chrome console always reports an error, saying that the provider is unknown. Please let me know if injector() needs to pass parameters? For example, a self-defined module? Or what are the specific services of get?

PHPzPHPz2842 days ago748

reply all(2)I'll reply

  • PHPz

    PHPz2017-05-15 17:06:45

    Official website documentation

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-15 17:06:45

    You can do this in the chrome console:

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

    reply
    0
  • Cancelreply