本文整理汇总了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();
}