ng-template if else

agnusdei·2023년 7월 13일
0

<ng-container *ngIf="(auth$ | async).user?.id; else loggedOut">

  <div class="px-10 font-semibold cursor-pointer" (click)="logout()">
    Log out
  </div>
</ng-container>
<ng-template #loggedOut>
  <div class="px-10 font-semibold cursor-pointer" routerLink="/login">
    Log In
  </div>
</ng-template>

0개의 댓글