Újabb megoldás:
<main>
<ul id="users">
@for (user of users; track user.id) {
<li>
<app-user
[user]="user"/> (select)="onSelectUser($event)"
</li>
}
</ul>
@if (selectedUser) {
<app-tasks [name]="selectedUser.name"/>
} @else {
<p id="fallback">Select a user</p>
}
</main>
legacy:
<!-- @if (selectedUser) {-->
<app-tasks *ngIf="selectedUser; else vmifallback" [name]="selectedUser.name"/> //importálni kell!!!!
<!-- } @else {-->
<ng-template #vmifallback><!-- ugyanaz a neve mint fentebb!!!!! -->
<p id="fallback">Select a user</p>
</ng-template>
<!-- }-->