How to hide and show button based on variable value


#1

How to hide and show button based on variable value.
I’m trying like this

<button ion-button color="secondary" (click)="accept($event, item)" *ngIf="item.booking_staus == Comfirm">Confirm</button>
<button ion-button color="secondary" (click)="accept($event, item)" *ngIf="item.booking_staus == Pending">Confirm</button>

Please help me out
Thanks


#2
  1. Typo in booking_status?
  2. Is Confirm and Pending a variable or a string? If you meant it as a string then you should place it within quotation marks.
*ngIf=" item.booking_status == 'Comfirm' " 
*ngIf=" item.booking_status == 'Pending' " 
  1. What else do you have as ‘booking_status’ options?