ngb-pagination is not resetting to page 1 on clearing all the filters

120 Views Asked by At

I am trying clear filters and reload the page however the ngb-pagination highlights the previous page. I tried resetting the page number to 1 but still not updating

for eg: if I apply filters and I am on page 3 and then clear filter, I refresh the data as per the need but page active state is still 3 instead of page 1

HTML:

<ngb-pagination [collectionSize]="70" [(page)]="page" aria-label="Default pagination"></ngb-pagination>

TS:

import { Component } from '@angular/core';

@Component({
  selector: 'ngbd-pagination-basic',
  templateUrl: './pagination-basic.html',
})
export class NgbdPaginationBasic {
  page = 1;

  resetPage() {
    this.page = 1
  }
}
0

There are 0 best solutions below