Angular 2 disabled controls do not get included in the form.value

后端 未结 4 1541
遥遥无期
遥遥无期 2020-12-07 14:41

I have noticed that if I disable a control on an Angular 2 reactive form then the control does not get included in the form.value. For example, if I define my form like bel

4条回答
  •  渐次进展
    2020-12-07 15:18

    Thank you @Sasxa for getting me 80% what I needed.

    For those of you looking for a solution to the same problem but for nested forms I was able to solve by changing my usual

    this.notelinkingForm.get('nestedForm').value
    

    to

    this.notelinkingForm.getRawValue().nestedForm
    

提交回复
热议问题