@@ -13,7 +13,7 @@ import {
1313} from '@angular/core' ;
1414import { CommonModule } from '@angular/common' ;
1515import { NG_VALUE_ACCESSOR , ControlValueAccessor } from '@angular/forms' ;
16- import { BooleanFieldValue , MdRippleModule } from '../core' ;
16+ import { MdRippleModule , coerceBooleanProperty } from '../core' ;
1717
1818/**
1919 * Monotonically increasing integer used to auto-generate unique ids for checkbox components.
@@ -90,15 +90,24 @@ export class MdCheckbox implements ControlValueAccessor {
9090 @Input ( ) id : string = `md-checkbox-${ ++ nextId } ` ;
9191
9292 /** Whether the ripple effect on click should be disabled. */
93- @Input ( ) @BooleanFieldValue ( ) disableRipple : boolean = false ;
93+ private _disableRipple : boolean = false ;
94+
95+ @Input ( )
96+ get disableRipple ( ) { return this . _disableRipple ; }
97+ set disableRipple ( v ) { this . _disableRipple = coerceBooleanProperty ( v ) ; }
9498
9599 /** ID to be applied to the `input` element */
96100 get inputId ( ) : string {
97101 return `input-${ this . id } ` ;
98102 }
99103
100104 /** Whether the checkbox is required or not. */
101- @Input ( ) @BooleanFieldValue ( ) required : boolean = false ;
105+ private _required : boolean ;
106+
107+ /** Whether the checkbox is required or not. */
108+ @Input ( )
109+ get required ( ) : boolean { return this . _required ; }
110+ set required ( value ) { this . _required = coerceBooleanProperty ( value ) ; }
102111
103112 /** Whether or not the checkbox should come before or after the label. */
104113 @Input ( ) align : 'start' | 'end' = 'start' ;
@@ -341,10 +350,6 @@ export class MdCheckbox implements ControlValueAccessor {
341350 getHostElement ( ) {
342351 return this . _elementRef . nativeElement ;
343352 }
344-
345- isRippleEnabled ( ) {
346- return ! this . disableRipple ;
347- }
348353}
349354
350355
0 commit comments