I ran into this problem while running a test page that would display components for visual inspection.
I tried the ngIf approach mentioned in another answer, but it did not work without using setTimeout , which is more like a hack.
It turns out that ngFor perfect for this. You just use an array with a single empty object. Each time you modify the array, ngFor will re-create the internal component.
public reset: any[] = [{}]; public onRecreate() { this.reset[0] = {}; }
Then in your template
<my-child-component *ngFor="let r of reset"></my-child-component> <button (click)="onRecreate()">Reset</button>
source share