Open
Description
The docs include this example that shows how to write a custom validator for a field:
[
{
key: 'name',
validationMessage: {
'noBob': 'Bob is not OK! You here me?'
},
$validators: {
noBob: function(value) {
if (angular.isString(value) && value.indexOf('Bob') !== -1) {
return false;
}
return true
}
}
}
]
Is it somehow possible to use other field values in a custom validator? For example, if we want to apply the validation above only if model.gender == 'MALE'
?