angular-paginate-anything icon indicating copy to clipboard operation
angular-paginate-anything copied to clipboard

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

Open thai-dinh-tam opened this issue 10 years ago • 6 comments

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

thai-dinh-tam avatar Apr 14 '15 22:04 thai-dinh-tam

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?

begriffs avatar Apr 25 '15 17:04 begriffs

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

thai-dinh-tam avatar May 04 '15 19:05 thai-dinh-tam

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.

thai-dinh-tam avatar May 04 '15 19:05 thai-dinh-tam

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.

thai-dinh-tam avatar May 04 '15 21:05 thai-dinh-tam

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

begriffs avatar May 05 '15 00:05 begriffs

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
                            });
                        }
                    });


thai-dinh-tam avatar May 05 '15 00:05 thai-dinh-tam