Answers for "if statement in angular html"

0

if angular

<div *ngIf="condition">Content to render when condition is true.</div>
Posted by: Guest on February-09-2021
0

ngif else

<ng-container
  *ngIf="isLoggedIn; then loggedIn; else loggedOut">
</ng-container>

<ng-template #loggedIn>
  <div>
    Welcome back, friend.
  </div>
</ng-template>
<ng-template #loggedOut>
  <div>
    Please friend, login.
  </div>
</ng-template>
Posted by: Guest on April-06-2020
1

ng if

<ng-template [ngIf]="heroes" [ngIfElse]="loading">
 <div class="hero-list">
  ...
 </div>
</ng-template>

<ng-template #loading>
 <div>Loading...</div>
</ng-template>
Posted by: Guest on September-30-2020

Code answers related to "if statement in angular html"

Browse Popular Code Answers by Language