Comments (13)
@triniwiz I wouldn't fix anything for anyone shouting "ASAP" at me.
from nativescript-pager.
After upgrading to the latest works! thanks :D
from nativescript-pager.
What does your items
collection look like? How is that observable collection populated?
We use this plugin in a lazy-loaded module without those listed problems (iOS and Android).
from nativescript-pager.
with using an attribute async , that would be component:
export class DummyComponent {
items: any;
constructor() {
this.items = new BehaviorSubject([
{
title: "Slide 1",
image: "~/images/Hulk_(comics_character).png"
},
{
title: "Slide 2",
image: "https://s-media-cache-ak0.pinimg.com/originals/4c/92/cc/4c92cc1dfbde6a6a40fe799f56fa9294.jpg"
}])
}
}
or without attribute async
maybe items with items:any = [{id:0}, {id: 1}];
fine works without loadChildren inside routing, i dont know how to implement this pluginin mode lazy, becaseu it's generating error Cannot read property 'nativeView' of null
from nativescript-pager.
Perhaps try moving the items instantiation to an ngOnInit
life-cycle hook.
Our implementation is like:
<Pager [items]="banners$ | async" (selectedIndexChange)="onIndexChanged($event)" #bannerEl>
<ng-template pagerItemTemplate let-banner="item" let-i="index">
<GridLayout paddingLeft="10" paddingRight="10">
<loop-banner [banner]="banner" [expanded]="bannerExpanded"></loop-banner>
</GridLayout>
</ng-template>
</Pager>
where banners$
is an observable subscription to ngrx state:
this.banners$ = this.store$.select(getBanners);
This lives in our DashboardComponent, which is part of a lazy-loaded module:
{
path: 'dashboard',
children: [
{ path: '', pathMatch: 'full', redirectTo: 'user' },
{
path: 'user',
loadChildren:
'./+dashboard-user/dashboard-user.module#DashboardUserModule'
}
]
},
from nativescript-pager.
Sorry, it doesn't solve my problem.
from nativescript-pager.
@mpochron still receiving the same error after upgrading to the latest ?
from nativescript-pager.
@triniwiz ..
I am back...
<Pager [items]="items | async" #pager [selectedIndex]="currentPagerIndex" (selectedIndexChange)="onIndexChanged($event)" class="pager">
<ng-template pagerItemTemplate let-i="index" let-item="item">
<GridLayout class="pager-item" rows="auto, *" columns="*" backgroundColor="red">
<Label [text]="'TEST'"></Label>
</GridLayout>
</ng-template>
</Pager>
But each row keeps to print "[object Object]" ? Why?
from nativescript-pager.
import { NgModule } from "@angular/core";
import { NativeScriptRouterModule } from "nativescript-angular/router";
import { Routes } from "@angular/router";
import { TestComponent } from "./test/test.component";
import { TestMultiComponent } from './test-multi/test-multi.component';
import { DummyComponent } from "./dummy.component";
const routes: Routes = [
{ path: '', redirectTo: '/test', pathMatch: 'full' },
{ path: 'test', component: TestComponent },
{ path: 'multi', component: TestMultiComponent },
{
path: 'dummy',
loadChildren: "./dummy/dummy.modules#DummyModule",
}
];
@NgModule({
imports: [NativeScriptRouterModule.forRoot(routes)],
exports: [NativeScriptRouterModule]
})
export class AppRoutingModule { }
After using loadChildren still keeps to show [object Object]
, but sliding works. Please ASAP fix it.
from nativescript-pager.
A work around you can try is getting the pager instance then call pagerInstance.reload(true)
from nativescript-pager.
Oh found bug.
<Pager [items]="contacts | async" #pager class="pager" showNativePageIndicator="true">
<ng-template pagerItemTemplate let-i="index" let-item="item">
<StackLayout>
<Label *ngFor="let contact of item" [text]="contact.firstName"></Label>
</StackLayout>
</ng-template>
</Pager>
From the beginning method ngFor was the reason. Without ngFor well works. Any idea how to fix and use ngFor in that situation?
from nativescript-pager.
You can try upgrading
from nativescript-pager.
But thanks, i found other answer thanks to creating custom component where can have ngFor.
from nativescript-pager.
Related Issues (20)
- iOS orientation issue using Pager + HtmlView HOT 3
- Vue Template Selector HOT 1
- iOS: item snap does not work while swiping when using tns-ios-v8-beta HOT 6
- iOS Image pager jerked when I swipe left HOT 4
- Changing a property on nested object causes ordering problems HOT 6
- iOS indicator color is not applied HOT 3
- Add vertical and horizontal orientation at the same time HOT 2
- Pager discards global context
- Error angular 9.1.0 HOT 3
- Angular 10 @nativescript-community/ui-pager 13.0.0-alpha.5 module import is not working HOT 2
- @nativescript-community/ui-pager":"^13.0.0-alpha.7 - Error - cant resolve - element-registry, lang-facade HOT 3
- Error: Can't resolve '@nativescript/core/data/observable-array/observable-array' Nativescript 7 HOT 3
- 13.0.0-alpha.10 crash with transformers="scale"
- selectedIndexChange value is undefined.
- Just Programatically Control HOT 1
- Feature Request: Revamping swipeEnd events HOT 1
- Unshift + selectedIndex bugged HOT 8
- 3 Pages in one view HOT 1
- Textview keyboard dismisses after one key tap.
- Build error on NS 8.4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-pager.