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

Loads collection twice

Open papaiatis opened this issue 9 years ago • 2 comments

I have configured the directive as follows:

    <div class="col-lg-12 text-center" ng-init="page = 0; perPage = 5;">
        <house-list houses="houses"></house-list>
        <bgf-pagination collection="houses" page="page" per-page="perPage" client-limit="perPage"
                        url="'/api/houses/'"
                        template-url="/views/pagination.houses.html"></bgf-pagination>
    </div>

The directive loads the "/api/houses/" URL twice and both cases the same data are returned. Even in your demo the "words" API is called 4 times! Demo: http://begriffs.com/angular-paginate-anything/?page=0&perPage=5

papaiatis avatar May 20 '15 19:05 papaiatis

You're right, I see the duplication in the demo. (Also the 4x thing happens because each request is calling the OPTIONS verb and then a GET, so two calls done twice.)

This codebase is starting to get overcomplicated by the interaction of various features introduced over time. Ideally I'd like to create a regression test for this and try to refactor the code. The next couple weeks are pretty busy for me though. I'd appreciate any debugging or you can do or a pull request.

begriffs avatar May 20 '15 20:05 begriffs

in the past i have added some tests for a similar issue : https://github.com/begriffs/angular-paginate-anything/pull/18

i don't know why it is not effective, probably not so similar

polo2ro avatar Jul 19 '15 09:07 polo2ro