mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
@@ -125,6 +125,7 @@ export class RadioGroup {
|
||||
registerOnChange(fn: Function): void {
|
||||
this._fn = fn;
|
||||
this.onChange = (val: any) => {
|
||||
// onChange used when there's an ngControl
|
||||
console.debug('radio group, onChange', val);
|
||||
fn(val);
|
||||
this.value = val;
|
||||
@@ -206,7 +207,14 @@ export class RadioGroup {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onChange(_) {}
|
||||
onChange(val: any) {
|
||||
// onChange used when there is not an ngControl
|
||||
console.debug('radio group, onChange w/out ngControl', val);
|
||||
this.value = val;
|
||||
this._update();
|
||||
this.onTouched();
|
||||
this.change.emit(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -13,7 +13,6 @@ class E2EApp {
|
||||
currencies: Array<string>;
|
||||
items: Array<{description: string, value: any}>;
|
||||
relationship: string;
|
||||
pet: string;
|
||||
selectedTime: number = 60;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<code><b>relationship:</b> {{relationship}}</code>
|
||||
</div>
|
||||
|
||||
<div radio-group [(ngModel)]="pet" (change)="petChange($event)">
|
||||
<div radio-group (change)="petChange($event)">
|
||||
<p>
|
||||
<ion-radio (select)="dogSelect($event)"></ion-radio>
|
||||
Dogs
|
||||
@@ -95,10 +95,6 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div padding>
|
||||
<code><b>pet:</b> {{pet}}</code>
|
||||
</div>
|
||||
|
||||
<ion-list radio-group [(ngModel)]="someValue">
|
||||
<ion-item *ngFor="#item of items">
|
||||
<ion-label>
|
||||
|
||||
Reference in New Issue
Block a user