Git Product home page Git Product logo

Comments (9)

triniwiz avatar triniwiz commented on September 25, 2024 1

For a quick fix as @sean-perkins mentioned you can call _initNativeViewPager() from the page instance to fix the initial load problem

from nativescript-pager.

triniwiz avatar triniwiz commented on September 25, 2024 1

Yes a temp solution 😊

from nativescript-pager.

triniwiz avatar triniwiz commented on September 25, 2024 1

Fixed in v7

from nativescript-pager.

jdnichollsc avatar jdnichollsc commented on September 25, 2024

@triniwiz but it's a temporal solution, right? @sean-perkins can you paste your solution here to help others with the same issue? thanks guys!

from nativescript-pager.

jdnichollsc avatar jdnichollsc commented on September 25, 2024

I lost the temporal solution of @sean-perkins 🙈

from nativescript-pager.

jdnichollsc avatar jdnichollsc commented on September 25, 2024

For the moment the solution is using a ng-container with an Observable array:

<ng-container *ngIf="(images | async)?.length > 0">
    <Pager [items]="images | async" #pager class="pager">
        <ng-template pagerItemTemplate let-i="index" let-item="item">
            <GridLayout class="pager-item" rows="auto, *" columns="*" backgroundColor="red">
                <Label [text]="item.title"></Label>
                <Image row="1" [src]="item.image"></Image>
            </GridLayout>
        </ng-template>
    </Pager>
</ng-container>

We can convert a regular array to an observable using:

import { of } from 'rxjs/observable/of'
...
images: Observable<any[]>
ngOnInit() {
  let images = []
  this.images = of(images)
}

Thanks guys and thank you so much @sean-perkins for your help!

from nativescript-pager.

jdnichollsc avatar jdnichollsc commented on September 25, 2024

Guys, by the other hand... My app is crashing when I use the following configuration from the template:

[selectedIndex]="currentPagerIndex" (selectedIndexChange)="onIndexChanged($event)"

Let me know what you think, thanks in advance! 👍

from nativescript-pager.

jdnichollsc avatar jdnichollsc commented on September 25, 2024

For the moment I'm using a variable loadingImages with the ng-container to reload the component, because the selectedIndex doesn't work

from nativescript-pager.

jdnichollsc avatar jdnichollsc commented on September 25, 2024

Woww thanks @triniwiz, let me check! 👍

from nativescript-pager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.