This repository was archived by the owner on Sep 16, 2022. It is now read-only.

Description
Consider the following example:
<button (click)="show = !show">Toggle</button>
<div *ngIf="show">
<hello-world @deferred></hello-world>
</div>
Pressing the Toggle button will alternate between adding and removing the <hello-world> component from the DOM. This behavior is broken, if this example is changed so that the parent element of the @deferred component is itself a <template>:
<button (click)="show = !show">Toggle</button>
<template [ngIf]="show">
<hello-world @deferred></hello-world>
</template>
Now rather than alternating between adding and removing the <hello-world> component, pressing the Toggle button will alternative between adding and doing nothing. This means new <hello-world> components will be repeatedly appended to the DOM.