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

后端 未结 4 1530
遥遥无期
遥遥无期 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:25

    You can use:

    this.notelinkingForm.getRawValue()
    

    From Angular docs:

    If you'd like to include all values regardless of disabled status, use this method. Otherwise, the value property is the best way to get the value of the group.

提交回复
热议问题