Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Switching to changeDetection.OnPush in this commit has the effect that changing the page size no longer works. This points to an underlying problem that not all state of the pagination component is stored in the ngrx store, otherwise onPush would work.
Another likely related issues is that if you go to the second page of a paginated list, click on an item and use the browser's back button, you see the results of the first page, but the second page is still highlighted
I should have solved the resize issue by adding local change detection checks as here.
About the second issue I think that the right behavior should be to get back to the last page visited, that in the example is the second page. In this case I've seen that the PaginationComponent works properly, should it be an issue related to cache or REST call? I've tested a simple paginated list page and the same use case works well.
Pagination has a glitch with universal. When the prerender finishes and swaps the cache on the client the pagination switches to the first page and back to the desired page quickly. It is noticible in development mode and more so with replay redux prerender strategy. In production mode with rehydrate prerender strategy, it happens but so quick it cannot be noticed. If the console is opened, it slows everything down enough to notice it even in production mode.
This may be an issue with ngx-pagination library. Does it fully support Angular Universal?
The desired behavior would be to never fetch and render any page but the page described in the query string.
This is required for smooth page refresh and deep linking.