Skip to content

Commit

Permalink
fix(module: input-item): fix inputitem value protect (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuonuoge authored and fisherspy committed Dec 26, 2018
1 parent e2c0157 commit 883c2ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/input-item/input-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ export class InputItem implements OnInit, OnChanges, ControlValueAccessor {
set value(v: string) {
if (typeof v === undefined || v === null) {
this._value = '';
} else {
this._value = v;
}
this._value = v;
}
@Input()
get defaultValue(): string {
Expand Down Expand Up @@ -340,8 +341,9 @@ export class InputItem implements OnInit, OnChanges, ControlValueAccessor {
writeValue(value: any): void {
if (typeof value === undefined || value === null) {
this._value = '';
} else {
this._value = value;
}
this._value = value;
}

registerOnChange(fn: (_: any) => void): void {
Expand Down

0 comments on commit 883c2ba

Please sign in to comment.