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

Multitemplate Angular, only default template is displayed #43

Closed
farzeni opened this issue Feb 15, 2018 · 1 comment
Closed

Multitemplate Angular, only default template is displayed #43

farzeni opened this issue Feb 15, 2018 · 1 comment

Comments

@farzeni
Copy link

farzeni commented Feb 15, 2018

Which platform(s) does your issue occur on?

Tryed on Android but probably affects both

Please, provide the following version numbers that your issue occurs with:

  • CLI: 3.4.1
  • Cross-platform modules: 3.4.0
  • Runtime(s): 3.4.1
  • Plugin(s): nativescript-pager 7.0.12,

Please, tell us how to recreate the issue in as much detail as possible.

Hello @triniwiz,

When I try to create a multitemplate pager in a angular app on android platform, templates are ignored and just the first one is picked up.

I debugged a little bit your plugin and I noted that pagerTemplateKey are correctly parsed and registerTemplate method is called. The problem is that registerTemplate fills _templateMap variable but internally pager uses itemTemplates property to look for registered templates which is filled by setItemTemplates. But the latest is never called when a new template is registered.

I added a call to setItemTemplates at the end of registerTemplate and things seem to work again, but I'm not sure it is the right solution, maybe you can tell me something better.

Here is what i changed:
farzeni@fd3b525

Thank you for your work

@farzeni farzeni changed the title Multitemplate Angular Multitemplate Angular, only default template is displayed Feb 15, 2018
@triniwiz
Copy link
Owner

Good catch 😄

This issue was closed.
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

2 participants