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

Pagination itemsPerPage resets to initial value on refresh #209

Open
thevoiceofzeke opened this issue Feb 1, 2016 · 1 comment
Open

Comments

@thevoiceofzeke
Copy link

Hello,

I'm using ng-tasty with a rather heavily customized table that includes custom pagination templates. The templates work wonderfully, but I noticed that refreshing the page will always reset itemsPerPage to whatever its initial setting is in the angular controller. I am trying to find a solution that will allow me to capture the itemsPerPage value when it changes, then save it in $rootScope so it persists when the page is refreshed via something like this:

if ($rootScope.itemsPerPage) {
    $scope.itemsPerPage = $rootScope.itemsPerPage;
} else {
    $scope.itemsPerPage = 5;
}

Because the pagination template is controlled by ng-tasty, I'm at a loss for how I would go about doing this.

@seminull
Copy link

I would try solving this problem with local/session storage. There's a few angular modules that make it pretty easy out there.

ngStorage
angular-local-storage

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

No branches or pull requests

2 participants