NgModuleRef
Represents an instance of an NgModule created by an NgModuleFactory. Provides access to the NgModule instance and related objects.
API
abstract class NgModuleRef<T> {
abstract readonly injector: EnvironmentInjector;
abstract readonly instance: T;
abstract destroy(): void;
abstract onDestroy(callback: () => void): void;
}
injector
EnvironmentInjectorThe injector that contains all of the providers of the NgModule.
instance
TThe NgModule instance.
destroy
voidDestroys the module instance and all of the data structures associated with it.
@returns
void
onDestroy
voidRegisters a callback to be executed when the module is destroyed.
@paramcallback
() => void
@returns
void
Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/core/NgModuleRef