linkComponentRef
npm Package | @angular/core |
---|---|
Module | import { ComponentRef } from '@angular/core'; |
Source | core/src/linker/component_factory.ts |
linkOverview
class ComponentRef<C> {
get location: ElementRef
get injector: Injector
get instance: C
get hostView: ViewRef
get changeDetectorRef: ChangeDetectorRef
get componentType: Type<any>
destroy(): void
onDestroy(callback: Function): void
}
linkDescription
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.