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

Loads collection twice #71

Open
papaiatis opened this issue May 20, 2015 · 2 comments
Open

Loads collection twice #71

papaiatis opened this issue May 20, 2015 · 2 comments

Comments

@papaiatis
Copy link
Contributor

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

@begriffs
Copy link
Owner

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.

@polo2ro
Copy link

polo2ro commented Jul 19, 2015

in the past i have added some tests for a similar issue :
#18

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

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

3 participants