test(infinitescroll): infinite-scroll w/in nav test

This commit is contained in:
Adam Bradley
2016-03-07 16:40:01 -06:00
parent 06d77a26e4
commit 9b73422b7d
2 changed files with 31 additions and 7 deletions

View File

@ -1,13 +1,13 @@
import {App, InfiniteScroll} from 'ionic-angular';
import {App, Page, InfiniteScroll, NavController} from 'ionic-angular';
@App({
@Page({
templateUrl: 'main.html'
})
class E2EApp {
class E2EPage1 {
items = [];
constructor() {
constructor(private nav: NavController) {
for (var i = 0; i < 30; i++) {
this.items.push( this.items.length );
}
@ -30,9 +30,33 @@ class E2EApp {
});
}
goToPage2() {
this.nav.push(E2EPage2);
}
}
function getAsyncData() {
@Page({
template: '<ion-content><button (click)="nav.pop()">Pop</button></ion-content>'
})
class E2EPage2 {
constructor(private nav: NavController) {}
}
@App({
template: '<ion-nav [root]="root"></ion-nav>'
})
class E2EApp {
root;
constructor() {
this.root = E2EPage1;
}
}
function getAsyncData(): Promise<any[]> {
// async return mock data
return new Promise(resolve => {

View File

@ -3,9 +3,9 @@
<ion-content>
<ion-list>
<ion-item *ngFor="#item of items">
<button ion-item (click)="goToPage2()" *ngFor="#item of items">
{{ item }}
</ion-item>
</button>
</ion-list>
<ion-infinite-scroll (infinite)="doInfinite($event)" threshold="100px">