Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent from setting totalItems for in memory pagination. #115

Closed
MateuszG opened this issue Jan 18, 2017 · 1 comment
Closed

Prevent from setting totalItems for in memory pagination. #115

MateuszG opened this issue Jan 18, 2017 · 1 comment

Comments

@MateuszG
Copy link

MateuszG commented Jan 18, 2017

Angular 2 version:

2.4.3

ng2-pagination version:

2.0.0

Description of issue:

When I use in config of pipe property totalItems for example: totalItems: products.length for in-memory paging, paginate pipe stop working. You can change pages but paginate list all items on every page.

Steps to reproduce:

Expected result:

I think that there should be more visible warning in the documentation for developer, that totalItems shoud be removed or maybe make in memory page working with this propery, add new property (mode of pagination) for pagination config?

Actual result:

There is not info at all in module, only short information in readme. I spent a few hours figuring out what is the reason.

Any relevant code:


 *ngFor="let product of products | paginate: { id: 'cart', itemsPerPage: itemsPerPage, currentPage: currentPage, totalItems: products.length}; let i = index">

@michaelbromley
Copy link
Owner

Hi,

Thanks for the feedback, and I'm sorry you lost a few hours trying to figure this out!

I agree that it would be better to have the in-memory mode just work even if you specify totalItems: collection.length. I will look at adding this into the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants