Answers for "angular ngif display div"

12

ngif else

<div *ngIf="isLoggedIn; else loggedOut">
  Welcome back, friend.
</div>

<ng-template #loggedOut>
  Please friend, login.
</ng-template>
Posted by: Guest on April-01-2020
1

angular.io hide

<div [style.visibility]="(numberOfUnreadAlerts == 0) ? 'hidden' : 'visible' ">
   COUNTER: {{numberOfUnreadAlerts}} 
</div>
Posted by: Guest on November-28-2020

Browse Popular Code Answers by Language