aurelia / validatejs

Enables expressive validation using decorators and/or a fluent API.
MIT License
22 stars 23 forks source link

Consider 'computedFrom' support #28

Closed MaximBalaganskiy closed 8 years ago

MaximBalaganskiy commented 8 years ago

It would be nice to have. I could work around it by triggering validation in passes analog if it existed

plwalters commented 8 years ago

What is computedFrom? Does equality not cover this?

MaximBalaganskiy commented 8 years ago

It does for password and confirmation, but more complex scenarios may require triggering validation on other fields. Let's say you picked a state and depending on that your prices might become invalid...

plwalters commented 8 years ago

All of the relevant rules are re-evaluated upon validating the object so this shouldn't be needed.

For example -

firstName = 'Blue';
@equality('firstName') lastName = 'Blue';

// lastName is valid

person.firstName = 'Red';

// reporter.subscribe returns `Last name does not equal first name`