Skip to content

Commit ea7d1d9

Browse files
committed
Cast NgModel value to a boolean
1 parent f93649c commit ea7d1d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/slide-toggle/slide-toggle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export class MdSlideToggle implements OnDestroy, AfterContentInit, ControlValueA
175175

176176
/** Implemented as part of ControlValueAccessor. */
177177
writeValue(value: any): void {
178-
this.checked = value;
178+
this.checked = !!value;
179179
}
180180

181181
/** Implemented as part of ControlValueAccessor. */

0 commit comments

Comments
 (0)