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

reload-page never works , gotopage also never works... #70

Open
TannerMeng opened this issue Apr 14, 2015 · 6 comments
Open

reload-page never works , gotopage also never works... #70

TannerMeng opened this issue Apr 14, 2015 · 6 comments

Comments

@TannerMeng
Copy link

is it because reload-page and gotopage are isolated scope ?

@begriffs
Copy link
Owner

Hmm, there is a passing test for this here:
https://github.com/begriffs/angular-paginate-anything/blob/master/test/paginate-anything-spec.js#L411-L421

Can you give me more information about your code and situation?

@TannerMeng
Copy link
Author

would you please give me more samples how to use reload-page ?

@TannerMeng
Copy link
Author

in template
<bgf-paginationpage="page" per-page="generalPerPage"
client-limit="clientLimit"
collection="gqs"
url = "generalPageUrl"
repload-page = "reloadPageFlag"
passive = 'false'
template-url="/templates/directive/paginate-anything.html">
</bgf-pagination>

In controller
SomeService.updateSomething({},function(data){
                    $scope.reloadPageFlag = true;
                })

Above code doesn't reload page, when updateSomething callback is called.

@TannerMeng
Copy link
Author

It was my mistake. repload-page = "reloadPageFlag", misspelling. repload.

However i found one more issue. reload page doesn't work several times....
It works only one time.

@begriffs
Copy link
Owner

begriffs commented May 5, 2015

Maybe you have to toggle it from true to false and back to true in order to get another reload.

@TannerMeng
Copy link
Author

In your code, I saw it you already toggle it false.

$scope.$watch('reloadPage', function(newVal, oldVal) {
                        if($scope.passive === 'true') { return; }

                        if(newVal === true && oldVal === false) {
                            $scope.reloadPage = false;
                            requestRange({
                                from: $scope.page * $scope.perPage,
                                to: ($scope.page+1) * $scope.perPage - 1
                            });
                        }
                    });


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