fix(forms): Update types for TypeScript nullability support (#15859)

This commit is contained in:
Miško Hevery
2017-04-13 17:14:08 -07:00
committed by Tobias Bosch
parent fdb3f26448
commit 6a2e08d0a8
27 changed files with 343 additions and 330 deletions

View File

@ -47,7 +47,7 @@ export class NumberValueAccessor implements ControlValueAccessor {
this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', normalizedValue);
}
registerOnChange(fn: (_: number) => void): void {
registerOnChange(fn: (_: number|null) => void): void {
this.onChange = (value) => { fn(value == '' ? null : parseFloat(value)); };
}
registerOnTouched(fn: () => void): void { this.onTouched = fn; }