#how to disabled a button with ngIf

3 messages · Page 1 of 1 (latest)

rustic forge
#

hello i want to ask something

<div class="page-button me-auto">
<button type="button" class="btn btn-outline-secondary rounded-pill me-1" *ngIf="!p.isFirstPage()"(click)="p.previous()">Previous Page
</button>
<button type="button" class="btn btn-primary rounded-pill ms-1" *ngIf="!p.isLastPage()" (click)="p.next()">Next Page </button>
</div>

my code is like this, i'm using ngx pagination, in this code *ngIf="!p.isFirstPage()" if on the first page, the previous page button is disappeared, instead i want to add disabled class on my button class if i'm on the first page, how can i do that?

sorry just a newbie

#

oh i've found it

#

[disabled]="p.isFirstPage()===true"