ComponentRef
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 }
描述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. 方法
Location of the Host Element of this Component Instance.
The injector on which the component instance exists.
The instance of the Component.
The ViewRef of the Host View of this Component instance.
The ChangeDetectorRef of the Component instance.
The component type.
Destroys the component instance and all of the data structures associated with it.
Allows to register a callback that will be called when the component is destroyed. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |