This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

createInjector

Create a new Injector which is configured using a defType of InjectorType<any>s.

createInjector(defType: any, parent: Injector | null = null, additionalProviders: StaticProvider[] | null = null): Injector
      
      createInjector(defType: any, parent: Injector | null = null, additionalProviders: StaticProvider[] | null = null): Injector
    

Parameters

defType

Type: any.

parent

Type: Injector | null.

Optional. Default is null.

additionalProviders

Type: StaticProvider[] | null.

Optional. Default is null.

Returns

Injector