angular-paginate-anything
angular-paginate-anything copied to clipboard
Loads collection twice
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
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.
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