Class Overview
class ComponentRef {
C
location
: ElementRef
injector
: Injector
instance
: C
hostView
: ViewRef
changeDetectorRef
: ChangeDetectorRef
componentType
: Type<any>
destroy
() : void
onDestroy
(callback: Function) : void
}
Class Description
Represents an instance of a Component created via a ComponentFactory
.
ComponentRef
provides access to the Component Instance as well other objects related to this
Component Instance and allows you to destroy the Component Instance via the destroy
method.
Class Details
C
location : ElementRef
Location of the Host Element of this Component Instance.
injector : Injector
The injector on which the component instance exists.
instance : C
The instance of the Component.
hostView : ViewRef
The ViewRef
of the Host View of this Component instance.
changeDetectorRef : ChangeDetectorRef
The ChangeDetectorRef
of the Component instance.
componentType : Type<any>
The component type.
destroy() : void
Destroys the component instance and all of the data structures associated with it.
onDestroy(callback: Function) : void
Allows to register a callback that will be called when the component is destroyed.
exported from core/index, defined in core/src/linker/component_factory.ts