I am working with Angular formly and according to this site: https://formly.dev/guide/validation, I should be able to do this:
{
"id": "blah.blah.blah",
"key": "blah",
"type": "search-grid",
...
"validators": {
"familyUnit": {
"expression": "(c) => model.validatorOutput === '' || model.validatorOutput === []",
"message": "Invalid!"
}
}
},
{
"id": "validatorOutput",
"key": "validatorOutput",
"type": "output",
"expressionProperties": {
"templateOptions.url": "!!model.blah?.selection ? `/api/v3/.../${model.blah?.selection?.id}/...` : ''"
},
"hideExpression": "true"
}
This is JSON but we read JSON files and convert them into formly objects.
My question is: why doesn't this work? According to the website above, it should work. But I get the following error in the chrome console:
ERROR TypeError: r.validation is not a function