Files
Brandy Carney 45e37ceb29 test(e2e): update all e2e tests to use a local path to ionic
this lets type errors to show up during development

closes #6366
2016-04-29 15:34:56 -04:00

96 lines
1.6 KiB
TypeScript

import {App, Page, NavController} from '../../../../../ionic';
@Page({
templateUrl: 'first.html'
})
class FirstPage {
constructor(private _nav: NavController) {
}
goToSecond() {
this._nav.push(SecondPage);
}
}
@Page({
templateUrl: 'second.html'
})
class SecondPage {
constructor() {
this.searchQuery = '';
this.initializeItems();
}
initializeItems() {
this.items = [
'Amsterdam',
'Bogota',
'Buenos Aires',
'Cairo',
'Dhaka',
'Edinburgh',
'Geneva',
'Genoa',
'Glasglow',
'Hanoi',
'Hong Kong',
'Islamabad',
'Istanbul',
'Jakarta',
'Kiel',
'Kyoto',
'Le Havre',
'Lebanon',
'Lhasa',
'Lima',
'London',
'Los Angeles',
'Madrid',
'Manila',
'New York',
'Olympia',
'Oslo',
'Panama City',
'Peking',
'Philadelphia',
'San Francisco',
'Seoul',
'Taipeh',
'Tel Aviv',
'Tokio',
'Uelzen',
'Washington'
];
}
getItems(searchbar) {
// Reset items back to all of the items
this.initializeItems();
// set q to the value of the searchbar
var q = searchbar.value;
// if the value is an empty string don't filter the items
if (q.trim() == '') {
return;
}
this.items = this.items.filter((v) => {
if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
return true;
}
return false;
})
}
}
@App({
template: '<ion-nav [root]="root"></ion-nav>'
})
class E2EApp {
constructor() {
this.root = FirstPage;
}
}