Credit to devdocs.io

angular 2.0_typescript

angular

NgModuleRef

Stable Class

Class Overview

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

Class Description

Represents an instance of an NgModule created via a NgModuleFactory.

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

Class Details

injector : Injector

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

componentFactoryResolver : ComponentFactoryResolver

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

instance : T

The NgModule instance.

destroy() : void

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

onDestroy(callback: () => void) : void

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

exported from @angular/core/index, defined in @angular/core/src/linker/ng_module_factory.ts

© 2010–2016 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/docs/ts/latest/api/core/index/NgModuleRef-class.html