mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
chore(): rename properties to inputs, events to outputs
This commit is contained in:
@ -16,7 +16,7 @@ class AppPage {
|
|||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[parallax]',
|
selector: '[parallax]',
|
||||||
properties: [
|
inputs: [
|
||||||
'parallax'
|
'parallax'
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@ -8,7 +8,7 @@ import {dom} from 'ionic/util';
|
|||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[parallax]',
|
selector: '[parallax]',
|
||||||
properties: [
|
inputs: [
|
||||||
'parallax',
|
'parallax',
|
||||||
'counter'
|
'counter'
|
||||||
]
|
]
|
||||||
|
@ -56,7 +56,7 @@ let WEATHER_ICONS = {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'weather-icon',
|
selector: 'weather-icon',
|
||||||
properties: [
|
inputs: [
|
||||||
'icon'
|
'icon'
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -80,7 +80,7 @@ export class WeatherIcon {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'current-time',
|
selector: 'current-time',
|
||||||
properties: [
|
inputs: [
|
||||||
'localtz'
|
'localtz'
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -100,7 +100,7 @@ export class CurrentTime {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'current-weather',
|
selector: 'current-weather',
|
||||||
properties: [
|
inputs: [
|
||||||
'current'
|
'current'
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -175,7 +175,7 @@ export class CurrentWeather {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'background-cycler',
|
selector: 'background-cycler',
|
||||||
properties: [
|
inputs: [
|
||||||
'image'
|
'image'
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@ -30,7 +30,7 @@ import {IonicApp} from './app';
|
|||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[id]',
|
selector: '[id]',
|
||||||
properties: ['id']
|
inputs: ['id']
|
||||||
})
|
})
|
||||||
export class IdRef {
|
export class IdRef {
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import {IonicComponent} from '../../config/decorators';
|
|||||||
*/
|
*/
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-checkbox',
|
selector: 'ion-checkbox',
|
||||||
properties: [
|
inputs: [
|
||||||
'value',
|
'value',
|
||||||
'checked',
|
'checked',
|
||||||
'disabled',
|
'disabled',
|
||||||
|
@ -26,7 +26,7 @@ import {ScrollTo} from '../../animations/scroll-to';
|
|||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-content',
|
selector: 'ion-content',
|
||||||
properties: [
|
inputs: [
|
||||||
'parallax'
|
'parallax'
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@ -8,7 +8,7 @@ import {IonicConfig} from '../../config/config';
|
|||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: 'icon',
|
selector: 'icon',
|
||||||
properties: [
|
inputs: [
|
||||||
'name',
|
'name',
|
||||||
'ios',
|
'ios',
|
||||||
'md',
|
'md',
|
||||||
|
@ -17,8 +17,8 @@ export class Ion {
|
|||||||
onInit() {
|
onInit() {
|
||||||
let cls = this.constructor;
|
let cls = this.constructor;
|
||||||
|
|
||||||
if (cls.defaultProperties && this.config) {
|
if (cls.defaultInputs && this.config) {
|
||||||
for (let prop in cls.defaultProperties) {
|
for (let prop in cls.defaultInputs) {
|
||||||
// Priority:
|
// Priority:
|
||||||
// ---------
|
// ---------
|
||||||
// 1) Value set from within constructor
|
// 1) Value set from within constructor
|
||||||
@ -42,7 +42,7 @@ export class Ion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// wasn't set yet, so go with property's default value
|
// wasn't set yet, so go with property's default value
|
||||||
this[prop] = cls.defaultProperties[prop];
|
this[prop] = cls.defaultInputs[prop];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import * as util from 'ionic/util';
|
|||||||
*/
|
*/
|
||||||
@IonicDirective({
|
@IonicDirective({
|
||||||
selector: 'ion-list',
|
selector: 'ion-list',
|
||||||
properties: [
|
inputs: [
|
||||||
'items',
|
'items',
|
||||||
'virtual',
|
'virtual',
|
||||||
'content'
|
'content'
|
||||||
@ -74,7 +74,7 @@ export class List extends Ion {
|
|||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: 'ion-header',
|
selector: 'ion-header',
|
||||||
properties: [
|
inputs: [
|
||||||
'id'
|
'id'
|
||||||
],
|
],
|
||||||
host: {
|
host: {
|
||||||
|
@ -9,7 +9,7 @@ import {IonicApp} from '../app/app';
|
|||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[menu-close]',
|
selector: '[menu-close]',
|
||||||
properties: [
|
inputs: [
|
||||||
'menuClose'
|
'menuClose'
|
||||||
],
|
],
|
||||||
host: {
|
host: {
|
||||||
|
@ -11,7 +11,7 @@ import {Navbar} from '../nav-bar/nav-bar';
|
|||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[menu-toggle]',
|
selector: '[menu-toggle]',
|
||||||
properties: [
|
inputs: [
|
||||||
'menuToggle'
|
'menuToggle'
|
||||||
],
|
],
|
||||||
host: {
|
host: {
|
||||||
|
@ -45,19 +45,19 @@ import * as gestures from './menu-gestures';
|
|||||||
*/
|
*/
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-menu',
|
selector: 'ion-menu',
|
||||||
properties: [
|
inputs: [
|
||||||
'content',
|
'content',
|
||||||
'dragThreshold',
|
'dragThreshold',
|
||||||
'id'
|
'id'
|
||||||
],
|
],
|
||||||
defaultProperties: {
|
defaultInputs: {
|
||||||
'side': 'left',
|
'side': 'left',
|
||||||
'type': 'reveal'
|
'type': 'reveal'
|
||||||
},
|
},
|
||||||
host: {
|
host: {
|
||||||
'role': 'navigation'
|
'role': 'navigation'
|
||||||
},
|
},
|
||||||
events: ['opening']
|
outputs: ['opening']
|
||||||
})
|
})
|
||||||
@View({
|
@View({
|
||||||
template: '<ng-content></ng-content><backdrop tappable disable-activated></backdrop>',
|
template: '<ng-content></ng-content><backdrop tappable disable-activated></backdrop>',
|
||||||
|
@ -36,7 +36,7 @@ import {NavRegistry} from './nav-registry';
|
|||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[nav-push]',
|
selector: '[nav-push]',
|
||||||
properties: [
|
inputs: [
|
||||||
'instruction: navPush',
|
'instruction: navPush',
|
||||||
'params: navParams'
|
'params: navParams'
|
||||||
],
|
],
|
||||||
|
@ -120,10 +120,10 @@ import {NavController} from './nav-controller';
|
|||||||
*/
|
*/
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-nav',
|
selector: 'ion-nav',
|
||||||
properties: [
|
inputs: [
|
||||||
'root'
|
'root'
|
||||||
],
|
],
|
||||||
defaultProperties: {
|
defaultInputs: {
|
||||||
'swipeBackEnabled': true
|
'swipeBackEnabled': true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -164,7 +164,7 @@ export class RadioGroup extends Ion {
|
|||||||
*/
|
*/
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-radio',
|
selector: 'ion-radio',
|
||||||
properties: [
|
inputs: [
|
||||||
'value',
|
'value',
|
||||||
'checked',
|
'checked',
|
||||||
'disabled',
|
'disabled',
|
||||||
|
@ -37,8 +37,7 @@ import {raf, ready, CSS} from 'ionic/util/dom';
|
|||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-refresher',
|
selector: 'ion-refresher',
|
||||||
events: ['refresh', 'starting', 'pulling'],
|
inputs: [
|
||||||
properties: [
|
|
||||||
'pullingIcon',
|
'pullingIcon',
|
||||||
'pullingText',
|
'pullingText',
|
||||||
'refreshingIcon',
|
'refreshingIcon',
|
||||||
@ -46,6 +45,7 @@ import {raf, ready, CSS} from 'ionic/util/dom';
|
|||||||
'spinner',
|
'spinner',
|
||||||
'disablePullingRotation'
|
'disablePullingRotation'
|
||||||
],
|
],
|
||||||
|
outputs: ['refresh', 'starting', 'pulling'],
|
||||||
host: {
|
host: {
|
||||||
'[class.active]': 'isActive',
|
'[class.active]': 'isActive',
|
||||||
'[class.refreshing]': 'isRefreshing',
|
'[class.refreshing]': 'isRefreshing',
|
||||||
|
@ -15,7 +15,7 @@ import * as util from 'ionic/util';
|
|||||||
*/
|
*/
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-scroll',
|
selector: 'ion-scroll',
|
||||||
properties: [
|
inputs: [
|
||||||
'scrollX', 'scrollY', 'zoom', 'maxZoom'
|
'scrollX', 'scrollY', 'zoom', 'maxZoom'
|
||||||
],
|
],
|
||||||
host: {
|
host: {
|
||||||
|
@ -17,11 +17,11 @@ import {IonicComponent} from '../../config/decorators';
|
|||||||
*/
|
*/
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-search-bar',
|
selector: 'ion-search-bar',
|
||||||
properties: [
|
inputs: [
|
||||||
'list',
|
'list',
|
||||||
'query'
|
'query'
|
||||||
],
|
],
|
||||||
defaultProperties: {
|
defaultInputs: {
|
||||||
'cancelText': 'Cancel',
|
'cancelText': 'Cancel',
|
||||||
'placeholder': 'Search'
|
'placeholder': 'Search'
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import {dom} from 'ionic/util';
|
|||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-segment',
|
selector: 'ion-segment',
|
||||||
appInjector: [ NgControl ],
|
appInjector: [ NgControl ],
|
||||||
properties: [
|
inputs: [
|
||||||
'value'
|
'value'
|
||||||
],
|
],
|
||||||
host: {
|
host: {
|
||||||
@ -125,7 +125,7 @@ export class Segment extends Ion {
|
|||||||
*/
|
*/
|
||||||
@IonicDirective({
|
@IonicDirective({
|
||||||
selector: 'ion-segment',
|
selector: 'ion-segment',
|
||||||
//properties: ['value'],
|
//inputs: ['value'],
|
||||||
host: {
|
host: {
|
||||||
'(change)': 'onChange($event.target.value)',
|
'(change)': 'onChange($event.target.value)',
|
||||||
'(input)': 'onChange($event.target.value)',
|
'(input)': 'onChange($event.target.value)',
|
||||||
@ -192,7 +192,7 @@ export class SegmentControlValueAccessor {
|
|||||||
*/
|
*/
|
||||||
@IonicDirective({
|
@IonicDirective({
|
||||||
selector: 'ion-segment-button',
|
selector: 'ion-segment-button',
|
||||||
properties: [
|
inputs: [
|
||||||
'value'
|
'value'
|
||||||
],
|
],
|
||||||
host: {
|
host: {
|
||||||
|
@ -31,7 +31,7 @@ import {Scroll} from '../scroll/scroll';
|
|||||||
*/
|
*/
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-slides',
|
selector: 'ion-slides',
|
||||||
properties: [
|
inputs: [
|
||||||
'loop',
|
'loop',
|
||||||
'index',
|
'index',
|
||||||
'bounce',
|
'bounce',
|
||||||
@ -449,7 +449,7 @@ export class Slides extends Ion {
|
|||||||
*/
|
*/
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-slide',
|
selector: 'ion-slide',
|
||||||
properties: ['zoom']
|
inputs: ['zoom']
|
||||||
})
|
})
|
||||||
@View({
|
@View({
|
||||||
template: `<div class="slide-zoom"><ng-content></ng-content></div>`
|
template: `<div class="slide-zoom"><ng-content></ng-content></div>`
|
||||||
|
@ -79,7 +79,7 @@ class MediaSwitch {
|
|||||||
*/
|
*/
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-switch',
|
selector: 'ion-switch',
|
||||||
properties: [
|
inputs: [
|
||||||
'value',
|
'value',
|
||||||
'checked',
|
'checked',
|
||||||
'disabled',
|
'disabled',
|
||||||
|
@ -41,7 +41,7 @@ import {Tabs} from './tabs';
|
|||||||
* set on each Tab.
|
* set on each Tab.
|
||||||
*
|
*
|
||||||
* To change the title and icon, use the `tab-title` and `tab-icon`
|
* To change the title and icon, use the `tab-title` and `tab-icon`
|
||||||
* properties:
|
* inputs:
|
||||||
* ```html
|
* ```html
|
||||||
* <ion-tabs>
|
* <ion-tabs>
|
||||||
* <ion-tab tab-title="Home" tab-icon="home" [root]="tabOneRoot"></ion-tab>
|
* <ion-tab tab-title="Home" tab-icon="home" [root]="tabOneRoot"></ion-tab>
|
||||||
@ -51,7 +51,7 @@ import {Tabs} from './tabs';
|
|||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-tab',
|
selector: 'ion-tab',
|
||||||
properties: [
|
inputs: [
|
||||||
'root',
|
'root',
|
||||||
'tabTitle',
|
'tabTitle',
|
||||||
'tabIcon'
|
'tabIcon'
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import {Component, Directive, View, Injector, NgFor, ElementRef, Optional, Host, forwardRef, NgZone, ViewContainerRef} from 'angular2/angular2';
|
import {Component, Directive, View, Injector, ElementRef, NgZone, Optional, Host, NgFor, forwardRef, ViewContainerRef} from 'angular2/angular2';
|
||||||
|
|
||||||
import {Ion} from '../ion';
|
import {Ion} from '../ion';
|
||||||
import {IonicApp} from '../app/app';
|
import {IonicApp} from '../app/app';
|
||||||
import {NavController} from '../nav/nav-controller';
|
import {NavController} from '../nav/nav-controller';
|
||||||
import {ViewController} from '../nav/view-controller';
|
import {ViewController} from '../nav/view-controller';
|
||||||
import {IonicComponent, IonicView} from '../../config/decorators';
|
import {IonicComponent} from '../../config/decorators';
|
||||||
import {IonicConfig} from '../../config/config';
|
import {IonicConfig} from '../../config/config';
|
||||||
|
import {Icon} from '../icon/icon';
|
||||||
import * as dom from 'ionic/util/dom';
|
import * as dom from 'ionic/util/dom';
|
||||||
|
|
||||||
|
|
||||||
@ -61,7 +62,7 @@ import * as dom from 'ionic/util/dom';
|
|||||||
*/
|
*/
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-tabs',
|
selector: 'ion-tabs',
|
||||||
defaultProperties: {
|
defaultInputs: {
|
||||||
'tabBarPlacement': 'bottom',
|
'tabBarPlacement': 'bottom',
|
||||||
'tabBarIcons': 'top'
|
'tabBarIcons': 'top'
|
||||||
}
|
}
|
||||||
@ -84,6 +85,8 @@ import * as dom from 'ionic/util/dom';
|
|||||||
'<ng-content></ng-content>' +
|
'<ng-content></ng-content>' +
|
||||||
'</section>',
|
'</section>',
|
||||||
directives: [
|
directives: [
|
||||||
|
Icon,
|
||||||
|
NgFor,
|
||||||
forwardRef(() => TabButton),
|
forwardRef(() => TabButton),
|
||||||
forwardRef(() => TabHighlight),
|
forwardRef(() => TabHighlight),
|
||||||
forwardRef(() => TabNavBarAnchor)
|
forwardRef(() => TabNavBarAnchor)
|
||||||
@ -220,7 +223,7 @@ export class Tabs extends NavController {
|
|||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '.tab-button',
|
selector: '.tab-button',
|
||||||
properties: ['tab'],
|
inputs: ['tab'],
|
||||||
host: {
|
host: {
|
||||||
'[attr.id]': 'btnId',
|
'[attr.id]': 'btnId',
|
||||||
'[attr.aria-controls]': 'panelId',
|
'[attr.aria-controls]': 'panelId',
|
||||||
|
@ -8,7 +8,7 @@ import {pointerCoord, hasPointerMoved} from '../../util/dom';
|
|||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: 'ion-label',
|
selector: 'ion-label',
|
||||||
properties: [
|
inputs: [
|
||||||
'id'
|
'id'
|
||||||
],
|
],
|
||||||
host: {
|
host: {
|
||||||
|
@ -72,7 +72,7 @@ export class TextInputElement {
|
|||||||
@IonicDirective({
|
@IonicDirective({
|
||||||
selector: 'ion-input',
|
selector: 'ion-input',
|
||||||
classId: 'item-input',
|
classId: 'item-input',
|
||||||
properties: [
|
inputs: [
|
||||||
'tabIndex'
|
'tabIndex'
|
||||||
],
|
],
|
||||||
host: {
|
host: {
|
||||||
|
Reference in New Issue
Block a user