Is it possible to assign multiple rules to validate input? For example I have two rules:
alphaRule: [
      v => /[a-zA-Z]+$/.test(v) || 'Field must only contain letters'
    ],
requiredRule: [
               v => !!v || "required field"
            ]
And I have number of controls. Some of them need only requiredRules, some - only alphaRule, but some - combination of alphaRule and requiredRule.
Can I combine it together?
something like
:rules = "alphaRule, requiredRule"
                If you want to leave both variables, you can just work with them like with JS arrays.
:rules = "alphaRule.concat(requiredRule)"
                        Just keep adding the rules into the array:
:rules = "[alphaRule, requiredRule].flat()"
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With