Skip to content

Commit 0d3cb0a

Browse files
authored
Merge pull request #235 from Vafilor/fix/text.area.value.missing
fix: issue where text area no longer had a value.
2 parents e32bd52 + c1181ce commit 0d3cb0a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/app/fields/textarea/textarea.component.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,19 @@ import { Parameter } from '../../../api';
88
styleUrls: ['./textarea.component.scss']
99
})
1010
export class TextareaComponent implements OnInit {
11-
@Input() data: Parameter;
1211
@Input() form: FormGroup;
13-
1412
textAreaControl: FormControl;
1513

14+
// tslint:disable-next-line:variable-name
15+
@Input() _data: Parameter;
16+
@Input() set data(value: Parameter) {
17+
this._data = value;
18+
this.textAreaControl.setValue(value.value);
19+
}
20+
get data(): Parameter {
21+
return this._data;
22+
}
23+
1624
constructor() {
1725
this.textAreaControl = new FormControl('');
1826
this.textAreaControl.valueChanges.subscribe(newValue => {

0 commit comments

Comments
 (0)