deepthan opened this issue 5 years ago · 0 comments
使用remove函数,它不会触发组件的生命周期,还得手动调用ngOnDestroy
constructor(private element: ElementRef) {} // 你要销毁的时候调用它 triggerDestroy(){ this.element.nativeElement.remove(); this.ngOnDestroy() }