0

I have a config json with 3 fields, the 3rd field being a calculated field from data in the previous 2 fields. Now the catch here is I have dot(.) in their key names. e.g. "something.someone" When I try rendering the form I get an error showing undefined. My 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']"
            }
          },
]
}

The error is : FormBuilderComponent.html:24 ERROR TypeError: [Formly Error] [Expression "model['pushin_temperature.kiln_id']"] Cannot set property 'kiln_id']' of undefined enter image description here

Thanks in advance!

1 Answer 1

0

The above question has been clarified and solved in a github thread of ngx-formly and the link for the same : ngx-formly github

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.