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

Showing empty <Label> instead of Slide Content (Angular 6) #79

Closed
alereisan opened this issue Oct 14, 2018 · 9 comments · Fixed by #81
Closed

Showing empty <Label> instead of Slide Content (Angular 6) #79

alereisan opened this issue Oct 14, 2018 · 9 comments · Fixed by #81

Comments

@alereisan
Copy link

alereisan commented Oct 14, 2018

Showing empty <Label> instead of Slide Content (Angular 6)

@triniwiz
Copy link
Owner

  1. Which platform
  2. All slides or the first

@alereisan
Copy link
Author

alereisan commented Oct 14, 2018 via email

@mailiam
Copy link
Contributor

mailiam commented Nov 26, 2018

also occurs on iOS 12 with N{5}
It only shows view like <Label [text]="item">

<Pager row="0" timetable
  [items]="availableTimetable.weekdays">
  <ng-template pagerItemTemplate let-i="index" let-day="item">
    <GridLayout times flexWrap="wrap"
      iosOverflowSafeArea="false">
      <StackLayout orientation="horizontal">
        <Button text="{{ '\ue080' }}"></Button>
        <Label text="{{day}}"></Label>
      </StackLayout>
      <FlexboxLayout class="part" flexWrap="wrap" 
        [width]="cardWidth" iosOverflowSafeArea="false"
        *ngFor="let part of availableTimetable.times">
        <ng-template ngFor let-time let-j="index" let-even="even" [ngForOf]="part">
          <Button text="{{ '\ue080' }}" [flexWrapBefore]="even"></Button>
          <Label  flexGrow="1" [text]="time"></Label>
        </ng-template>
      </FlexboxLayout>
    </GridLayout>
  </ng-template>
</Pager>

@mailiam
Copy link
Contributor

mailiam commented Nov 26, 2018

It looks like PagerComponent constructor is not even called.
false alarm, itemTemplateQuery is empty
I will take a deeper look into the problem

@mailiam
Copy link
Contributor

mailiam commented Nov 27, 2018

The problem lied on setItemTemplates that it is called when content is not yet initialized.

Calling setItemTemplates in ngAfterContentInit solved the issue.

NativeScritpt/nativescript-angular has refactored ListView to extend TemplatedItemsComponent

I suggest nativescript-pager can also benefit from extending TemplatedItemsComponent

@triniwiz what do you think?

@triniwiz
Copy link
Owner

@mailiam i've started https://github.com/triniwiz/nativescript-pager/tree/v9 you can test and lmk how things are running

@mailiam
Copy link
Contributor

mailiam commented Nov 29, 2018

@mailiam i've started https://github.com/triniwiz/nativescript-pager/tree/v9 you can test and lmk how things are running

I should've looked into latest commits.
It works as expected!

@triniwiz
Copy link
Owner

@mailiam i'm exploring android.support.v4.app.FragmentStatePagerAdapter before I release v9 to see if I can squeeze some performance out

@mailiam
Copy link
Contributor

mailiam commented Nov 29, 2018

Great! looking forward for v9 public release.
Thanks for awesome plugin.

@triniwiz triniwiz mentioned this issue Nov 30, 2018
Merged
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants