Merge branch 'master' into list-border-refactor

This commit is contained in:
Brandy Carney
2015-11-12 16:44:50 -05:00
8 changed files with 101 additions and 16 deletions

View File

@@ -49,13 +49,13 @@ export class BasicPage {
destructiveText: 'Delete',
titleText: 'Albums',
cancelText: 'Cancel',
cancel: function() {
cancel: () => {
console.log('Canceled');
},
destructiveButtonClicked: () => {
console.log('Destructive clicked');
},
buttonClicked: function(index) {
buttonClicked: (index) => {
console.log('Button clicked', index);
if (index == 1) { return false; }
return true;

View File

@@ -97,6 +97,7 @@ export function getPageFor(hash) {
'segment': inputs.SegmentPage,
'select': inputs.SelectPage,
'switch': inputs.SwitchPage,
'search': inputs.SearchPage,
'inputs': labels.BasicPage,
'fixed-inline-labels': labels.FixedInlinePage,

View File

@@ -1,6 +1,7 @@
export * from './checkbox/pages';
export * from './radio/pages';
export * from './range/pages';
export * from './search/pages';
export * from './segment/pages';
export * from './select/pages';
export * from './switch/pages';

View File

@@ -0,0 +1,69 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'inputs/search/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class SearchPage{
constructor() {
this.searchQuery = '';
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() {
var q = this.searchQuery;
if(q.trim() == '') {
return this.items;
}
return this.items.filter((v) => {
if(v.toLowerCase().indexOf(q.toLowerCase()) >= 0) {
return true;
}
return false;
})
}
}

View File

@@ -0,0 +1,14 @@
<ion-navbar *navbar hide-back-button class="android-attr">
<ion-title>
Search
</ion-title>
</ion-navbar>
<ion-content>
<ion-searchbar [(ng-model)]="searchQuery"></ion-searchbar>
<ion-list #list>
<ion-item *ng-for="#item of getItems()">
{{item}}
</ion-item>
</ion-list>
</ion-content>

View File

@@ -13,7 +13,7 @@ import * as helpers from '../../helpers';
'</ion-content>',
directives: [forwardRef(() => helpers.AndroidAttribute)],
})
class TabTextCtrl {
class TabTextPage {
constructor() {
}
}
@@ -28,8 +28,8 @@ class TabTextCtrl {
})
export class BasicPage {
constructor() {
this.tabOne = TabTextCtrl;
this.tabTwo = TabTextCtrl;
this.tabThree = TabTextCtrl;
this.tabOne = TabTextPage;
this.tabTwo = TabTextPage;
this.tabThree = TabTextPage;
}
}

View File

@@ -13,7 +13,7 @@ import * as helpers from '../../helpers';
'</ion-content>',
directives: [forwardRef(() => helpers.AndroidAttribute)],
})
class TabIconTextCtrl {
class TabIconTextPage {
constructor() {
}
}
@@ -29,9 +29,9 @@ class TabIconTextCtrl {
})
export class IconTextPage {
constructor() {
this.tabOne = TabIconTextCtrl;
this.tabTwo = TabIconTextCtrl;
this.tabThree = TabIconTextCtrl;
this.tabFour = TabIconTextCtrl;
this.tabOne = TabIconTextPage;
this.tabTwo = TabIconTextPage;
this.tabThree = TabIconTextPage;
this.tabFour = TabIconTextPage;
}
}

View File

@@ -13,7 +13,7 @@ import * as helpers from '../../helpers';
'</ion-content>',
directives: [forwardRef(() => helpers.AndroidAttribute)],
})
class TabIconCtrl {
class TabIconPage {
constructor() {
}
}
@@ -29,9 +29,9 @@ class TabIconCtrl {
})
export class IconPage {
constructor() {
this.tabOne = TabIconCtrl;
this.tabTwo = TabIconCtrl;
this.tabThree = TabIconCtrl;
this.tabFour = TabIconCtrl;
this.tabOne = TabIconPage;
this.tabTwo = TabIconPage;
this.tabThree = TabIconPage;
this.tabFour = TabIconPage;
}
}