Manually Set Value for FormBuilder Control

The Solution to Manually Set Value for FormBuilder Control is


Updated: 19/03/2017

this.form.controls['dept'].setValue(selected.id);

OLD:

For now we are forced to do a type cast:

(<Control>this.form.controls['dept']).updateValue(selected.id)

Not very elegant I agree. Hope this gets improved in future versions.

~ Answered on 2016-02-16 16:04:19


Most Viewed Questions: