test(virtual-scroll): add second page to vs basic

This commit is contained in:
Adam Bradley
2016-12-09 10:34:09 -06:00
parent 902a7676b4
commit d6b2a83fb1
2 changed files with 22 additions and 10 deletions

View File

@ -1,5 +1,5 @@
import { Component, ViewChild, ElementRef, NgModule } from '@angular/core';
import { IonicApp, IonicModule, Platform } from '../../../..';
import { Component, NgModule } from '@angular/core';
import { IonicApp, IonicModule, NavController, Platform } from '../../../..';
@Component({
@ -7,11 +7,9 @@ import { IonicApp, IonicModule, Platform } from '../../../..';
})
export class E2EPage {
items: any[] = [];
webview: string;
webview: string = '';
@ViewChild('content') content: ElementRef;
constructor(platform: Platform) {
constructor(platform: Platform, public navCtrl: NavController) {
for (var i = 0; i < 200; i++) {
this.items.push({
value: i,
@ -22,11 +20,14 @@ export class E2EPage {
}
if (platform.is('ios')) {
if (window.indexedDB) {
this.webview = ': WKWebView';
if (platform.testUserAgent('Safari')) {
this.webview = ': iOS Safari';
} else if (!!window['webkit']) {
this.webview = ': iOS WKWebView';
} else {
this.webview = ': UIWebView';
this.webview = ': iOS UIWebView';
}
}
}
@ -35,10 +36,13 @@ export class E2EPage {
if (index % 4 === 0) {
return index + ' is divisible by 4';
}
return null;
}
pushPage() {
this.navCtrl.push(E2EPage);
}
reload() {
window.location.reload(true);
}

View File

@ -12,6 +12,10 @@
<ion-content>
<div padding>
<button ion-button (click)="pushPage()">Push Virtual Scroll Page</button>
</div>
<ion-list [virtualScroll]="items"
[headerFn]="headerFn">
@ -25,4 +29,8 @@
</ion-list>
<div padding>
<button ion-button (click)="pushPage()">Push Virtual Scroll Page</button>
</div>
</ion-content>