@@ -132,19 +132,7 @@ export class MdRadioGroup extends _MdRadioGroupMixinBase
132
132
}
133
133
134
134
/** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */
135
- _labelPosition : 'before' | 'after' = 'after' ;
136
- @Input ( )
137
- get labelPosition ( ) : 'before' | 'after' {
138
- return this . _labelPosition ;
139
- }
140
- set labelPosition ( v : 'before' | 'after' ) {
141
- this . _labelPosition = v
142
- if ( this . _radios ) {
143
- this . _radios . forEach ( ( radio ) => {
144
- radio . labelPosition = this . _labelPosition ;
145
- } ) ;
146
- }
147
- }
135
+ @Input ( ) labelPosition : 'before' | 'after' = 'after' ;
148
136
149
137
/** Value of the radio button. */
150
138
@Input ( )
@@ -174,6 +162,8 @@ export class MdRadioGroup extends _MdRadioGroupMixinBase
174
162
this . _checkSelectedRadioButton ( ) ;
175
163
}
176
164
165
+ constructor ( private _change : ChangeDetectorRef ) { }
166
+
177
167
/**
178
168
* Initialize properties once content children are available.
179
169
* This allows us to propagate relevant attributes to associated buttons.
@@ -235,6 +225,7 @@ export class MdRadioGroup extends _MdRadioGroupMixinBase
235
225
*/
236
226
writeValue ( value : any ) {
237
227
this . value = value ;
228
+ this . _change . markForCheck ( ) ;
238
229
}
239
230
240
231
/**
@@ -290,34 +281,15 @@ export class MdRadioButton implements OnInit, AfterViewInit, OnDestroy {
290
281
@Input ( ) name : string ;
291
282
292
283
/** Used to set the 'aria-label' attribute on the underlying input element. */
293
- _ariaLabel : string ;
294
- @Input ( 'aria-label' )
295
- get ariaLabel ( ) : string {
296
- return this . _ariaLabel ;
297
- }
298
- set ariaLabel ( value : string ) {
299
- this . _ariaLabel = value ;
300
- this . _change . markForCheck ( ) ;
301
- }
284
+ @Input ( 'aria-label' ) ariaLabel : string ;
302
285
303
286
/** The 'aria-labelledby' attribute takes precedence as the element's text alternative. */
304
- _ariaLabelledby : string ;
305
- @Input ( 'aria-labelledby' )
306
- get ariaLabelledby ( ) : string {
307
- return this . _ariaLabelledby ;
308
- }
309
- set ariaLabelledby ( value : string ) {
310
- this . _ariaLabelledby = value ;
311
- this . _change . markForCheck ( ) ;
312
- }
287
+ @Input ( 'aria-labelledby' ) ariaLabelledby : string ;
313
288
314
289
/** Whether the ripple effect for this radio button is disabled. */
315
290
@Input ( )
316
291
get disableRipple ( ) : boolean { return this . _disableRipple ; }
317
- set disableRipple ( value ) {
318
- this . _disableRipple = coerceBooleanProperty ( value ) ;
319
- this . _change . markForCheck ( ) ;
320
- }
292
+ set disableRipple ( value ) { this . _disableRipple = coerceBooleanProperty ( value ) ; }
321
293
322
294
/**
323
295
* Event emitted when the checked state of this radio button changes.
@@ -333,7 +305,6 @@ export class MdRadioButton implements OnInit, AfterViewInit, OnDestroy {
333
305
constructor ( @Optional ( ) radioGroup : MdRadioGroup ,
334
306
private _elementRef : ElementRef ,
335
307
private _renderer : Renderer ,
336
- private _change : ChangeDetectorRef ,
337
308
public radioDispatcher : UniqueSelectionDispatcher ) {
338
309
// Assertions. Ideally these should be stripped out by the compiler.
339
310
// TODO(jelbourn): Assert that there's no name binding AND a parent radio group.
@@ -374,7 +345,6 @@ export class MdRadioButton implements OnInit, AfterViewInit, OnDestroy {
374
345
// Notify all radio buttons with the same name to un-check.
375
346
this . _radioDispatcher . notify ( this . id , this . name ) ;
376
347
}
377
- this . _change . markForCheck ( ) ;
378
348
}
379
349
}
380
350
@@ -396,7 +366,6 @@ export class MdRadioButton implements OnInit, AfterViewInit, OnDestroy {
396
366
this . radioGroup . selected = this ;
397
367
}
398
368
}
399
- this . _change . markForCheck ( ) ;
400
369
}
401
370
}
402
371
@@ -413,7 +382,6 @@ export class MdRadioButton implements OnInit, AfterViewInit, OnDestroy {
413
382
414
383
set align ( v ) {
415
384
this . labelPosition = ( v == 'start' ) ? 'after' : 'before' ;
416
- this . _change . markForCheck ( ) ;
417
385
}
418
386
419
387
private _labelPosition : 'before' | 'after' ;
@@ -426,7 +394,6 @@ export class MdRadioButton implements OnInit, AfterViewInit, OnDestroy {
426
394
427
395
set labelPosition ( value ) {
428
396
this . _labelPosition = value ;
429
- this . _change . markForCheck ( ) ;
430
397
}
431
398
432
399
/** Whether the radio button is disabled. */
0 commit comments