填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫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

註冊一個銷燬模組時要執行的回呼(Callback)。

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

      
      abstract onDestroy(callback: () => void): void
    
引數
callback () => void
返回值

void