NgModuleRef

Represents an instance of an NgModule created via a NgModuleFactory.

查看"说明"...

      
      abstract class NgModuleRef<T> {
  abstract injector: Injector
  abstract componentFactoryResolver: ComponentFactoryResolver
  abstract instance: T
  abstract destroy(): void
  abstract onDestroy(callback: () => void): void
}
    

说明

NgModuleRef provides access to the NgModule Instance as well other objects related to this NgModule Instance.

属性

属性说明
abstract injector: Injector 只读

The injector that contains all of the providers of the NgModule.

abstract componentFactoryResolver: ComponentFactoryResolver 只读

The ComponentFactoryResolver to get hold of the ComponentFactories declared in the entryComponents property of the module.

abstract instance: T 只读

The NgModule instance.

方法

Destroys the module instance and all of the data structures associated with it.

abstract destroy(): void
      
      abstract destroy(): void
    
参数

没有参数。

返回值

void

Allows to register a callback that will be called when the module is destroyed.

abstract onDestroy(callback: () => void): void
      
      abstract onDestroy(callback: () => void): void
    
参数
callback () => void
返回值

void