我最近开始学习Angular,我想从表单中获取值并将其发送到数据库[Firebase]。我正在使用angularfire2。
根据文档,有“setValue()”方法,但没有“value()”或“getValue()”方法。还有其他方法可以使用吗?
射线
在formgroup API中有一个名为value
的get属性。
你可以使用this.yourFormGroupName.value
获取表单组的值。
如果要获取已禁用控件的值,可以使用getRawValue()
方法。 this.yourFormGroupName.getRawValue()
。
您的问题和标题说明不一样。
我想从表单中获取值
this.form.value