@@ -111,8 +111,23 @@ export class MdRadioGroup implements AfterContentInit, ControlValueAccessor {
111111 this . _updateRadioButtonNames ( ) ;
112112 }
113113
114- /** Alignment of the radio-buttons relative to their labels. Can be 'before' or 'after'. */
115- @Input ( ) align : 'before' | 'after' ;
114+ /**
115+ * Alignment of the radio-buttons relative to their labels. Can be 'before' or 'after'.
116+ * @deprecated
117+ */
118+ @Input ( )
119+ get align ( ) : 'start' | 'end' {
120+ // align refers to the checkbox relative to the label, while labelPosition refers to the
121+ // label relative to the checkbox. As such, they are inverted.
122+ return this . labelPosition == 'after' ? 'start' : 'end' ;
123+ }
124+
125+ set align ( v ) {
126+ this . labelPosition = ( v == 'start' ) ? 'after' : 'before' ;
127+ }
128+
129+ /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */
130+ @Input ( ) labelPosition : 'before' | 'after' = 'after' ;
116131
117132 @Input ( )
118133 get disabled ( ) : boolean {
@@ -363,16 +378,31 @@ export class MdRadioButton implements OnInit {
363378 }
364379 }
365380
366- private _align : 'before' | 'after' ;
381+ /**
382+ * Whether or not the radio-button should appear before or after the label.
383+ * @deprecated
384+ */
385+ @Input ( )
386+ get align ( ) : 'start' | 'end' {
387+ // align refers to the checkbox relative to the label, while labelPosition refers to the
388+ // label relative to the checkbox. As such, they are inverted.
389+ return this . labelPosition == 'after' ? 'start' : 'end' ;
390+ }
391+
392+ set align ( v ) {
393+ this . labelPosition = ( v == 'start' ) ? 'after' : 'before' ;
394+ }
395+
396+ private _labelPosition : 'before' | 'after' ;
367397
368- /** Alignment of the radio-button relative to their labels. Can be 'before' or 'after'. */
398+ /** Whether the label should appear after or before the radio button. Defaults to 'after' */
369399 @Input ( )
370- get align ( ) : 'before' | 'after' {
371- return this . _align || ( this . radioGroup != null && this . radioGroup . align ) || 'before ' ;
400+ get labelPosition ( ) : 'before' | 'after' {
401+ return this . _labelPosition || ( this . radioGroup && this . radioGroup . labelPosition ) || 'after ' ;
372402 }
373403
374- set align ( value : 'before' | 'after' ) {
375- this . _align = value ;
404+ set labelPosition ( value ) {
405+ this . _labelPosition = value ;
376406 }
377407
378408 /** Whether the radio button is disabled. */
0 commit comments