mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Merge branch 'master' into list-border-refactor
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
69
demos/component-docs/inputs/search/pages.ts
Normal file
69
demos/component-docs/inputs/search/pages.ts
Normal 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;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
14
demos/component-docs/inputs/search/template.html
Normal file
14
demos/component-docs/inputs/search/template.html
Normal 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>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user