本文整理匯總了TypeScript中@angular/core.ApplicationRef.detachView方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ApplicationRef.detachView方法的具體用法?TypeScript ApplicationRef.detachView怎麽用?TypeScript ApplicationRef.detachView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@angular/core.ApplicationRef
的用法示例。
在下文中一共展示了ApplicationRef.detachView方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
componentRef.onDestroy(() => {
this.applicationRef.detachView(componentRef.hostView);
});
示例2:
// Detaches the component from the root application node.
public detachFromApplication<T>(componentRef:ComponentRef<T>):void {
this._applicationRef.detachView(componentRef.hostView);
}
示例3:
this.setDisposeFn(() => {
this._appRef.detachView(componentRef.hostView);
componentRef.destroy();
});
示例4: closePopup
closePopup(): void {
this.appRef.detachView(this.componentRef.hostView);
this.componentRef.destroy();
this.componentRef = null;
}
示例5:
popupComponentRef.instance.closed.subscribe(() => {
document.body.removeChild(popup);
this.applicationRef.detachView(popupComponentRef.hostView);
});
示例6: removeComponent
public removeComponent() {
this.appRef.detachView(this.childComponentRef.hostView);
this.childComponentRef.destroy();
}
示例7: removeDialogComponentFromBody
private removeDialogComponentFromBody() {
this.appRef.detachView(this.dialogComponentRef.hostView);
this.dialogComponentRef.destroy();
}
示例8:
public removeComponent<T>(componentRef: ComponentRef<T>) {
this.appRef.detachView(componentRef.hostView);
componentRef.destroy();
}