1<div *ngIf="isLoggedIn; else loggedOut">
2 Welcome back, friend.
3</div>
4
5<ng-template #loggedOut>
6 Please friend, login.
7</ng-template>
8
1<div *ngIf="condition; else elseBlock">Content to render when condition is true.</div>
2<ng-template #elseBlock>Content to render when condition is false.</ng-template>
1
2 content_copy
3
4 <div *ngIf="condition; then thenBlock else elseBlock"></div>
5<ng-template #thenBlock>Content to render when condition is true.</ng-template>
6<ng-template #elseBlock>Content to render when condition is false.</ng-template>
7
1<ng-container
2 *ngIf="isLoggedIn; then loggedIn; else loggedOut">
3</ng-container>
4
5<ng-template #loggedIn>
6 <div>
7 Welcome back, friend.
8 </div>
9</ng-template>
10<ng-template #loggedOut>
11 <div>
12 Please friend, login.
13 </div>
14</ng-template>
15