Closed MikaelPorttila closed 8 years ago
I'm not exactly sure what your scenario is, but I've managed to solve what I think is a similar issue by doing something like the following:
ValidationRules.ensure("fieldToValidate").presence((value, self) => self.minOccurs > 0)
Hope this helps.
I don't think we're going to add conditional validation itself. However, we're working on a plan to enable custom validation rules. With that capability, you could implement a conditional validation system for your own app or even a plugin for the community. The best approach is to usually build what suits your own app best though since that will keep the core business logic firmly seated in your hands, rather than in ours, which is better for your long term.
The old validation had support for conditional validation with fluent-style if-statements. This feature appears to be missing in the new Aurelia-ValidateJS.