File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ export class RadioGroup {
125
125
registerOnChange ( fn : Function ) : void {
126
126
this . _fn = fn ;
127
127
this . onChange = ( val : any ) => {
128
+ // onChange used when there's an ngControl
128
129
console . debug ( 'radio group, onChange' , val ) ;
129
130
fn ( val ) ;
130
131
this . value = val ;
@@ -206,7 +207,14 @@ export class RadioGroup {
206
207
/**
207
208
* @private
208
209
*/
209
- onChange ( _ ) { }
210
+ onChange ( val : any ) {
211
+ // onChange used when there is not an ngControl
212
+ console . debug ( 'radio group, onChange w/out ngControl' , val ) ;
213
+ this . value = val ;
214
+ this . _update ( ) ;
215
+ this . onTouched ( ) ;
216
+ this . change . emit ( val ) ;
217
+ }
210
218
211
219
/**
212
220
* @private
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ class E2EApp {
13
13
currencies : Array < string > ;
14
14
items : Array < { description : string , value : any } > ;
15
15
relationship : string ;
16
- pet : string ;
17
16
selectedTime : number = 60 ;
18
17
19
18
constructor ( ) {
Original file line number Diff line number Diff line change 80
80
< code > < b > relationship:</ b > {{relationship}}</ code >
81
81
</ div >
82
82
83
- < div radio-group [(ngModel)] =" pet " (change) ="petChange($event) ">
83
+ < div radio-group (change) ="petChange($event) ">
84
84
< p >
85
85
< ion-radio (select) ="dogSelect($event) "> </ ion-radio >
86
86
Dogs
95
95
</ p >
96
96
</ div >
97
97
98
- < div padding >
99
- < code > < b > pet:</ b > {{pet}}</ code >
100
- </ div >
101
-
102
98
< ion-list radio-group [(ngModel)] ="someValue ">
103
99
< ion-item *ngFor ="#item of items ">
104
100
< ion-label >
You can’t perform that action at this time.
0 commit comments