angular4 formControl disabled表单提

2017-11-01  本文已影响0人  ningzuokun

应用场景

const ctrl = new FormControl({value: 'n/a', disabled: true});

通过 FormGroup getRawValue方法,可以获取包含disabled值

官方文档描述

/**

* The aggregate value of the{@linkFormGroup}, including any disabled controls.

*

* 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.

*/

上一篇 下一篇

猜你喜欢

热点阅读