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

Update dirPagination.js #80

Merged
merged 1 commit into from
Nov 18, 2014
Merged

Update dirPagination.js #80

merged 1 commit into from
Nov 18, 2014

Conversation

brunoporto
Copy link
Contributor

add watch on getItemsPerPage to make possible change itemsPerPage from scope.

row in rows | itemsPerPage: rowsPerPage

add watch on getItemsPerPage to make possible change itemsPerPage from scope.
```
row in rows | itemsPerPage: rowsPerPage
```
@michaelbromley
Copy link
Owner

Hi,

Thanks for the pull request. However, this functionality is already possible - see the demo: http://plnkr.co/edit/Wtkv71LIqUR4OhzhgpqL?p=preview
You'll notice that the demo uses this expression: meal in meals | filter:q | itemsPerPage: pageSize, where pageSize is a property defined on the scope.

Is there a case where your change enables additional functionality than is already possible?

@brunoporto
Copy link
Contributor Author

yes already possible, but if you try to remote resources it does not reload new items.

Example:
App load 5 items from the server (pageSize = 5)
Try changing pageSize to 10, will see that app dont load more items.

my change only force reload on current page.

@michaelbromley
Copy link
Owner

Ok, thanks for the clarification. I'll look into it after the weekend - make sure it works with all the tests etc.

michaelbromley added a commit that referenced this pull request Nov 18, 2014
dirPagination: add watch to itemsPerPage which calls the `goToPage()` method on change. This allows correct behaviour when working with async data.
@michaelbromley michaelbromley merged commit 2b3f425 into michaelbromley:master Nov 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants