I am facing issue using *ngIf to show different types of chart based on some flag. Its working in chrome but in IE11. *ngIf contents are getting added to DOM when flag is true, not getting deleted if flag is false.
Because of this each time I toggle flag new chart are getting created.
please help me. if I am doing something wring.
Context: We have two type of forms checkbox/radiobox. Once user clicks submit Button. Charts will rendered accordingly Checkbox - bar chart Radiobox - pie chart
contents are switched using *ngIf. its working in chrome.
In IE11, *When ngIf flag sets to false. element is not removed and replaced, instead creating new set of chart and forms.
<ht-check-form
*ngIf="!chartDisplay"
[surveyDetails]="survey"
(onFormSubmit)="submitSuvery($event)"
></ht-check-form>
<ht-chart
*ngIf="chartDisplay"
[surveyDetails]="survey"
[chartResult] = "chartData"
></ht-chart>
Sample code is in plunker: https://plnkr.co/edit/bANp2nJzyVMTFpK9F8NE?p=preview