@@ -146,9 +146,7 @@ export class MdRadioGroup extends _MdRadioGroupMixinBase
146
146
147
147
set labelPosition ( v ) {
148
148
this . _labelPosition = ( v == 'before' ) ? 'before' : 'after' ;
149
- if ( this . _radios ) {
150
- this . _radios . forEach ( radio => radio . _groupValueChanged ( ) ) ;
151
- }
149
+ this . _markRadiosForCheck ( ) ;
152
150
}
153
151
154
152
/** Value of the radio button. */
@@ -186,7 +184,7 @@ export class MdRadioGroup extends _MdRadioGroupMixinBase
186
184
this . _disabled = value ;
187
185
if ( this . _radios ) {
188
186
// Update radios disabled state
189
- this . _radios . forEach ( ( r ) => r . _groupValueChanged ( ) ) ;
187
+ this . _radios . forEach ( ( r ) => r . _markForCheck ( ) ) ;
190
188
}
191
189
}
192
190
@@ -249,6 +247,12 @@ export class MdRadioGroup extends _MdRadioGroupMixinBase
249
247
}
250
248
}
251
249
250
+ _markRadiosForCheck ( ) {
251
+ if ( this . _radios ) {
252
+ this . _radios . forEach ( radio => radio . _markForCheck ( ) ) ;
253
+ }
254
+ }
255
+
252
256
/**
253
257
* Sets the model value. Implemented as part of ControlValueAccessor.
254
258
* @param value
@@ -403,8 +407,6 @@ export class MdRadioButton implements OnInit, AfterViewInit, OnDestroy {
403
407
}
404
408
set disabled ( value : boolean ) {
405
409
this . _disabled = coerceBooleanProperty ( value ) ;
406
- // Update rippleDisabled
407
- this . _changeDetector . markForCheck ( ) ;
408
410
}
409
411
410
412
/**
@@ -466,7 +468,12 @@ export class MdRadioButton implements OnInit, AfterViewInit, OnDestroy {
466
468
this . _focusOriginMonitor . focusVia ( this . _inputElement . nativeElement , this . _renderer , 'keyboard' ) ;
467
469
}
468
470
469
- _groupValueChanged ( ) {
471
+ /**
472
+ * Marks the radio button as needing checking for change detection.
473
+ * This method is exposed because the parent radio group will directly
474
+ * update bound properties of the radio button.
475
+ */
476
+ _markForCheck ( ) {
470
477
// When group value changes, the button will not be notified. Use `markForCheck` to explicit
471
478
// update radio button's status
472
479
this . _changeDetector . markForCheck ( ) ;
0 commit comments