@@ -2,7 +2,7 @@ import {Component, View, Parent, Ancestor, Attribute} from 'angular2/angular2';
22import { Optional } from 'angular2/src/di/annotations' ;
33import { MdRadioDispatcher } from 'angular2_material/src/components/radio/radio_dispatcher'
44import { onChange } from 'angular2/src/core/annotations/annotations' ;
5- import { isPresent , StringWrapper } from 'angular2/src/facade/lang' ;
5+ import { isPresent , StringWrapper , NumberWrapper } from 'angular2/src/facade/lang' ;
66import { ObservableWrapper , EventEmitter } from 'angular2/src/facade/async' ;
77import { ListWrapper } from 'angular2/src/facade/collection' ;
88import { KEY_UP , KEY_DOWN , KEY_SPACE } from 'angular2_material/src/core/constants'
@@ -69,9 +69,9 @@ export class MdRadioButton {
6969 /** Dispatcher for coordinating radio unique-selection by name. */
7070 radioDispatcher : MdRadioDispatcher ;
7171
72- tabindex :any ;
73-
74- role :any ;
72+ tabindex : number ;
73+
74+ role : string ;
7575
7676 constructor (
7777 @Optional ( ) @Parent ( ) radioGroup : MdRadioGroup ,
@@ -105,7 +105,9 @@ export class MdRadioButton {
105105
106106 // If the user has not set a tabindex, default to zero (in the normal document flow).
107107 if ( ! isPresent ( radioGroup ) ) {
108- this . tabindex = isPresent ( tabindex ) ? tabindex : '0' ;
108+ this . tabindex = isPresent ( tabindex ) ? NumberWrapper . parseInt ( tabindex , 10 ) : 0 ;
109+ } else {
110+ this . tabindex = - 1 ;
109111 }
110112 }
111113
@@ -169,12 +171,12 @@ export class MdRadioButton {
169171 'value' : 'value'
170172 } ,
171173 hostListeners : {
172- 'keydown' : 'onKeydown($event)'
174+ // TODO(jelbourn): Remove ^ when event retargeting is fixed.
175+ '^keydown' : 'onKeydown($event)'
173176 } ,
174177 hostProperties : {
175178 'tabindex' : 'tabindex' ,
176179 'role' : 'attr.role' ,
177- 'checked' : 'attr.aria-checked' ,
178180 'disabled' : 'attr.aria-disabled' ,
179181 'activedescendant' : 'attr.aria-activedescendant'
180182 }
@@ -202,11 +204,11 @@ export class MdRadioGroup {
202204 /** The ID of the selected radio button. */
203205 selectedRadioId : string ;
204206
205- change :EventEmitter ;
207+ change : EventEmitter ;
206208
207- tabindex :any ;
209+ tabindex : number ;
208210
209- role :any ;
211+ role : string ;
210212
211213 constructor (
212214 @Attribute ( 'tabindex' ) tabindex : string ,
@@ -225,7 +227,7 @@ export class MdRadioGroup {
225227 this . disabled = isPresent ( disabled ) ;
226228
227229 // If the user has not set a tabindex, default to zero (in the normal document flow).
228- this . tabindex = isPresent ( tabindex ) ? tabindex : '0' ;
230+ this . tabindex = isPresent ( tabindex ) ? NumberWrapper . parseInt ( tabindex , 10 ) : 0 ;
229231 }
230232
231233 /** Gets the name of this group, as to be applied in the HTML 'name' attribute. */
@@ -319,6 +321,7 @@ export class MdRadioGroup {
319321
320322 this . radioDispatcher . notify ( this . name_ ) ;
321323 radio . checked = true ;
324+ ObservableWrapper . callNext ( this . change , null ) ;
322325
323326 this . value = radio . value ;
324327 this . selectedRadioId = radio . id ;
0 commit comments