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

Pagination component appears twice when using custom template #45

Closed
DanielMcAssey opened this issue Jun 10, 2016 · 13 comments
Closed

Pagination component appears twice when using custom template #45

DanielMcAssey opened this issue Jun 10, 2016 · 13 comments
Labels

Comments

@DanielMcAssey
Copy link

Angular 2 version: 2.0.0-rc.1

ng2-pagination version: 0.3.2

Description of issue: When using a custom template on pagination, the pagination tool appears twice, one is the templated pagination and the other is the original pagination

Steps to reproduce: Add pagination with custom template

Expected result: A single templated pagination component

Actual result: 2 pagination components, 1 templated and the other default template

Demo: (if possible, edit this Plunker demo and paste the link to your fork)

Any relevant code:


chrome_2016-06-09_15-28-00

@DanielMcAssey
Copy link
Author

Nevermind saw that you fixed this recently

@DanielMcAssey
Copy link
Author

This has now started happening again since 0.3.4

@michaelbromley
Copy link
Owner

Hi, can you reproduce? I do not see this behaviour: http://plnkr.co/edit/vpvDEBPanuBmfvMk3JJ2?p=preview

@DarkDrim
Copy link

DarkDrim commented Jun 24, 2016

+1. I have the same thing happening:
1

The upper div is created using custom-template.
A second div is added automatically. There was like a angular2 rc2-3.
1

If you go to the second page (or any other) is an extra pagination disappear.
But for some reason, it appears when loading the first page.

@DarkDrim
Copy link

DarkDrim commented Jun 24, 2016

I discovered that it occurs during the installation id: 'xxx' in the configuration and *ngIf.
you can see here: http://plnkr.co/edit/70FAhxIquK27BCT7ao2w?p=preview
Apparently whole thing in *ngIf
However, earlier it worked well.

@DarkDrim
Copy link

If you put in the config default "totalItems: 1" - the second pagination disappears. But I think this is not the best solution.

@RichieTorres
Copy link

RichieTorres commented Jun 24, 2016

+1 I have this behaviour on RC3, but not in RC1, with custom template

@michaelbromley
Copy link
Owner

@DarkDrim Thanks for the Plunker demo. I can see that there is an *ngIf on the pagination-controls component. If you remove that, then the default template does not show up.

I'm not exactly sure why that is, but the general issue is to do with the fact that I recently switched the component's change detection strategy to OnPush - which has massive positive performance effects, but somehow causes this issue.

Not had time to upgrade and test on rc3 yet, and I will be away next week so will not be able to fix until the following week.

@DanielMcAssey
Copy link
Author

Any luck with this on RC.4?

@michaelbromley
Copy link
Owner

I am working on upgrading an app to rc.4 and when done, I will upgrade this library, hopefully by tomorrow. I'll see if this is still an issue then.

@DarkDrim
Copy link

@michaelbromley There are hopes that this bug will be fixed in the near future?

@michaelbromley
Copy link
Owner

@DarkDrim Yes, I am in progress on it. I have limited time to work on this project, but I am confident there will be a new version published later this week (thursday or friday) with a fix for this.

@michaelbromley
Copy link
Owner

Should be fixed now in v0.3.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants