top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Explain what is injector?

+3 votes
326 views
Explain what is injector?
posted Dec 18, 2014 by Muskan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

Injector:

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

The following always holds true:

var $injector = angular.injector();
expect($injector.get('$injector')).toBe($injector);
expect($injector.invoke(function($injector) {
  return $injector;
})).toBe($injector);
answer Feb 20, 2015 by Manikandan J
...