Answer the question
In order to leave comments, you need to log in
How to correctly remove an Angular component?
Hello!
I have a method that creates a component
manualParsing(): {
var component = this.cfr.resolveComponentFactory(LeadTemplateLoaderComponent);
this.tableViewComp = this.tableViewContainer.createComponent(component);
this.tableViewComp.instance._ref = this.tableViewComp;
this.tableViewComp.instance.loadedDataResponse = this.data;
this.tableViewComp.instance.currentFilePath = this.requestData.FilePath;
//etc
}
if (this.tableViewComp.instance.isTemplateLoaded) {
this.tableViewComp.destroy();
this.manualParsing();
//Method for new component
this.DoSomeWithNewComponent()
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question