API > @angular/core > @angular/core/global mode_edit code ng.getInjector global function Retrieves an Injector associated with an element, component or directive instance. ng.getInjector(elementOrDir: {} | Element): Injector Parameters elementOrDir {} | Element DOM element, component or directive instance for which to retrieve the injector. Returns Injector: Injector associated with the element, component or directive instance.