I am using ngbTooltip for my form. Currently I need to change my tooltip text according to status.
There are two status in my form. My status are
- element.checkinStatus = "pending"
- element.checkinStatus = "approved"
according to above status i need to change the tooltip content. I tried. But its not working.
<button mat-stroked-button type="button" class="action-btn"
ngbTooltip="{'PENDING' : element.checkinStatus=='pending','APPROVED' : element.checkinStatus=='approved'}"
(click)="editCheckIn('edit',element)">
<i class="fas fa-pencil-alt"></i>
</button>
how do this dynamically. thanks
CodePudding user response:
you can try to below way
[ngbTooltip]="{{element.checkinStatus=='pending' ? 'PENDING' : element.checkinStatus=='approved' ? 'APPROVED' : ''}}"
CodePudding user response:
try like this :
[ngbTooltip]="element.checkinStatus | uppercase"