mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
refactor(events): rename all Ionic events to start with ion
BREAKING CHANGES: Renamed all Ionic events to start with `ion`. The following events were renamed: - **Checkbox** - `change` -> `ionChange` - **DateTime** - `change` -> `ionChange` - `cancel` -> `ionCancel` - **InfiniteScroll** - `infinite` -> `ionInfinite` - **Menu** - `opening` -> `ionDrag` - `opened` -> `ionOpen` - `closed` -> `ionClose` - **Option** - `select` -> `ionSelect` - **Picker** - `change` -> `ionChange` - **RadioButton** - `select` -> `ionSelect` - **RadioGroup** - `change` -> `ionChange` - **Refresher** - `refresh` -> `ionRefresh` - `pulling` -> `ionPull` - `start` -> `ionStart` - **Searchbar** - `input` -> `ionInput` - `blur` -> `ionBlur` - `focus` -> `ionFocus` - `cancel` -> `ionCancel` - `clear` -> `ionClear` - **Segment** - `change` -> `ionChange` - `select` -> `ionSelect` - **Select** - `change` -> `ionChange` - `cancel` -> `ionCancel` - **Slides** - `willChange` -> `ionWillChange` - `didChange` -> `ionDidChange` - `move` -> `ionDrag` - **TabButton** - `select` -> `ionSelect` - **Tab** - `select` -> `ionSelect` - **Tabs** - `change` -> `ionChange` - **Toggle** - `change` -> `ionChange` Closes #6568
This commit is contained in:
@ -11,10 +11,10 @@ import {isTrueProperty, isPresent} from '../../util/util';
|
||||
* @usage
|
||||
* ```html
|
||||
* <ion-segment [(ngModel)]="relationship" primary>
|
||||
* <ion-segment-button value="friends" (select)="selectedFriends()">
|
||||
* <ion-segment-button value="friends" (ionSelect)="selectedFriends()">
|
||||
* Friends
|
||||
* </ion-segment-button>
|
||||
* <ion-segment-button value="enemies" (select)="selectedEnemies()">
|
||||
* <ion-segment-button value="enemies" (ionSelect)="selectedEnemies()">
|
||||
* Enemies
|
||||
* </ion-segment-button>
|
||||
* </ion-segment>
|
||||
@ -66,7 +66,7 @@ export class SegmentButton {
|
||||
/**
|
||||
* @output {SegmentButton} expression to evaluate when a segment button has been clicked
|
||||
*/
|
||||
@Output() select: EventEmitter<SegmentButton> = new EventEmitter();
|
||||
@Output() ionSelect: EventEmitter<SegmentButton> = new EventEmitter();
|
||||
|
||||
constructor(private _renderer: Renderer, private _elementRef: ElementRef) {}
|
||||
|
||||
@ -97,7 +97,7 @@ export class SegmentButton {
|
||||
@HostListener('click', ['$event'])
|
||||
private onClick(ev) {
|
||||
console.debug('SegmentButton, select', this.value);
|
||||
this.select.emit(this);
|
||||
this.ionSelect.emit(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -130,7 +130,7 @@ export class SegmentButton {
|
||||
*
|
||||
* @usage
|
||||
* ```html
|
||||
* <ion-segment [(ngModel)]="relationship" (change)="onSegmentChanged($event)" danger>
|
||||
* <ion-segment [(ngModel)]="relationship" (ionChange)="onSegmentChanged($event)" danger>
|
||||
* <ion-segment-button value="friends">
|
||||
* Friends
|
||||
* </ion-segment-button>
|
||||
@ -178,7 +178,7 @@ export class Segment {
|
||||
/**
|
||||
* @output {Any} expression to evaluate when a segment button has been changed
|
||||
*/
|
||||
@Output() change: EventEmitter<SegmentButton> = new EventEmitter();
|
||||
@Output() ionChange: EventEmitter<SegmentButton> = new EventEmitter();
|
||||
|
||||
|
||||
/**
|
||||
@ -231,10 +231,10 @@ export class Segment {
|
||||
ngAfterViewInit() {
|
||||
let buttons = this._buttons.toArray();
|
||||
for (let button of buttons) {
|
||||
button.select.subscribe((selectedButton) => {
|
||||
button.ionSelect.subscribe((selectedButton) => {
|
||||
this.writeValue(selectedButton.value);
|
||||
this.onChange(selectedButton.value);
|
||||
this.change.emit(selectedButton);
|
||||
this.ionChange.emit(selectedButton);
|
||||
});
|
||||
|
||||
if (isPresent(this.value)) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
<ion-toolbar>
|
||||
<ion-segment id="segment" [(ngModel)]="relationship" (change)="onSegmentChanged($event)">
|
||||
<ion-segment-button value="friends" (select)="onSegmentSelected($event)" class="e2eSegmentFriends">
|
||||
<ion-segment id="segment" [(ngModel)]="relationship" (ionChange)="onSegmentChanged($event)">
|
||||
<ion-segment-button value="friends" (ionSelect)="onSegmentSelected($event)" class="e2eSegmentFriends">
|
||||
Friends
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="enemies" (select)="onSegmentSelected($event)">
|
||||
<ion-segment-button value="enemies" (ionSelect)="onSegmentSelected($event)">
|
||||
Enemies
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
|
@ -4,7 +4,7 @@
|
||||
</ion-title>
|
||||
</ion-navbar>
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="selectedSegment" (change)="onSegmentChanged($event)">
|
||||
<ion-segment [(ngModel)]="selectedSegment" (ionChange)="onSegmentChanged($event)">
|
||||
<ion-segment-button value="first">
|
||||
First
|
||||
</ion-segment-button>
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
<ion-slides (change)="onSlideChanged($event)" #loopSlider>
|
||||
<ion-slides (ionDidChange)="onSlideChanged($event)" #loopSlider>
|
||||
<ion-slide *ngFor="let slide of slides">
|
||||
<h1>{{ slide.title }}</h1>
|
||||
</ion-slide>
|
||||
|
Reference in New Issue
Block a user