如何识别表单组中的哪个属性发出了valuechanges事件

问题描述

下面是嵌套表单组的结构

   this.userProfileSettingsForm = fb.group({
      general: fb.group({
        language: [],theme: []
      }),report: fb.group({
        display: [],density: [],})
    })

如果我像下面这样订阅一般组,那么我将获得更新后的所有属性值。但是我只想获取在表单中更新的属性对于Ex :如果我更改了常规 FormGroup下的属性 language ,则仅我想接收language属性的更新值。

    this.userProfileSettingsForm.controls.general.valueChanges.subscribe(
      (value: any) => {
        console.log(value)
      }
    )

有人可以告诉我如何通过订阅组来识别特定的属性更改吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)