填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

NgModuleRef

NgModule 创建的 NgModuleFactory 的实例。提供对 NgModule 实例和相关对象的访问。

Represents an instance of an NgModule created by an NgModuleFactory. Provides access to the NgModule instance and related objects.

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

属性

属性说明
abstract injector: Injector只读

包含 NgModule 所有提供者的注入器。

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

abstract componentFactoryResolver: ComponentFactoryResolver只读

此解析器可以检索本模块的 entryComponents 属性中声明的组件工厂。

The resolver that can retrieve the component factories declared in the entryComponents property of the module.

abstract instance: T只读

NgModule 实例。

The NgModule instance.

方法

销毁模块实例以及与其关联的所有数据结构。

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

      
      abstract destroy(): void
    
参数

没有参数。

返回值

void

注册一个销毁模块时要执行的回调。

Registers a callback to be executed when the module is destroyed.

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

void