I'm looking for a way to change the page of the mat-paginator inside of my HTML.
When I edit a user, I want to stay on the same page as the mat-paginator. So I store this information inside the currentPage variable.
But I want to say to angular, if this variable !null, go to this page of mat-paginator
<!-- Pagination -->
<mat-paginator *ngIf="!currentPage" color="primary" [hidden]="dataSource.totalItems === 0" [length]="dataSource.totalItems"
[pageSize]="dataSource.pageSize" [pageIndex]="dataSource.pageIndex - 1" [pageSizeOptions]="pageSizeOptions"
(page)="onPaginateChange($event)" showFirstLastButtons>
</mat-paginator>
thank you very much.
I tried to write two but I can't re-render pagination without an event.