【问题标题】:Angular-Formly - Access Model names for calculated fields with key names containing dot(.)Angular-Formly - 访问具有包含点(。)键名的计算字段的模型名称
【发布时间】:2021-09-19 14:04:45
【问题描述】:

我有一个包含 3 个字段的配置 json,第三个字段是根据前 2 个字段中的数据计算得出的字段。 现在这里的问题是我在他们的键名中有点(。)。例如“某事。某人” 当我尝试渲染表单时,出现显示未定义的错误。 我的 config_json :

{
"fieldGroupClassName": "row",
"fieldGroup": [
{
            "className": "col-2",
            "key": "remarks_backflow.bed",
            "type": "input",
            "templateOptions": {
              "type": "number",
              "label": "Bed",
              "placeholder": "",
              "required": true
            }
          },
{
            "className": "col-2",
            "key": "remarks_backflow.gas",
            "type": "input",
            "templateOptions": {
              "type": "number",
              "label": "Gas",
              "placeholder": "",
              "required": true
            }
          },
{
            "className": "col-2",
            "key": "remarks_backflow.diff",
            "type": "input",
            "templateOptions": {
              "type": "number",
              "label": "Difference",
              "placeholder": "",
              "required": true
            },
            "expressionProperties": {
              "model['remarks_backflow.diff']":"model['remarks_backflow.bed'] - model['remarks_backflow.gas']"
            }
          },
]
}

错误是: FormBuilderComponent.html:24 错误 TypeError: [Formly Error] [Expression "model['pushin_temperature.kiln_id']"] 无法设置未定义的属性 'kiln_id']'

提前致谢!

【问题讨论】:

    标签: javascript angular angular8 angular-formly ngx-formly


    【解决方案1】:

    上述问题已在 ngx-formly 的 github 线程中得到澄清和解决 相同的链接: ngx-formly github

    【讨论】:

      猜你喜欢
      • 2021-07-31
      • 1970-01-01
      • 2017-10-14
      • 2022-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多