I have 2 components. Both have mat-table and paginators and pagination is working for one component and not working for the other component though the code is similar. Below
I had a similar issue to this, with mat-paginator inside a container with a ngIf.
The only thing that worked for me was the comment:
Thank you - this was the solution for me. I opted to use [hidden] instead of ngIf so that the paginator would render even if there wasn't any data, but wouldn't show up to the user – TabsNotSpaces
To clarify, what I did was create a div, outside the container, with [hidden]=.