Manav Pandya
What is use of @Injector in Angular
By Manav Pandya in Angular on Mar 18 2018
  • Asad Ilyas
    Apr, 2018 12

    injector is used to retrieve object instances as defined by provider, instantiate types, invoke methods, and load modules.

    • 1
  • Asad Ilyas
    Apr, 2018 12

    injector is used to retrieve object instances as defined by provider, instantiate types, invoke methods, and load modules.

    • 1
  • Asad Ilyas
    Apr, 2018 12

    injector is used to retrieve object instances as defined by provider, instantiate types, invoke methods, and load modules.

    • 1
  • Jaipal Reddy
    Apr, 2018 3

    A service can be dynamically injected (by name) into a controller using the $injector. Being able to inject services via controller arguments is just a convenience that Angular provides. Under the hood, the $injector is used by Angular to retrieve object instances. But we can use the $injector ourselves also.function MyCtrl($scope, $injector) {$scope.doSomething = function(someService) {var service = $injector.get(someService) // someService contains the name of a serviceservice.value += 10 }https://stackoverflow.com/questions/14415845/angularjs-dynamically-inject-scope-or-controller/14418384#14418384https://docs.angularjs.org/api/auto/service/$injector

    • 1


Most Popular Job Functions


MOST LIKED QUESTIONS