We have an Angular Reactive Formbuilder
this.formBuilderGroup({
'productType':['',[Validators.required, Validators.min(3)]],
'deliveryCategory':['',[Validators.required, Validators.max(8)]]
})
They are actually driven from Material select dropdowns, and give Dto Objects. How do I have validators on actual Object members within?
such as productType.productTypeId Validator min is 1.
and deliveryCategory.deliveryCategoryNo min 1?
Validators.min is currently only on whole object.
How can I write custom Validator that will take object as object member as parameters? Or is there more optimal way?
[value]of the select is is what will get the validation rule. It's not the whole object. Can you create a StackBlitz?