You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior:
Aurelia-Validation has some great features for validating both properties and whole instances. The property-level features seem to be more fleshed-out than the instance-level features. I am developing an application that uses instance-level validation, and would like to propose some new features that will facilitate the use of instance-level validation, and provide more flexibility to the aurelia-validation framework in general.
Feature Requests:
Add the ability to detect when validation state has changed on a specific instance (and specific properties, for that matter). I am currently observing controller.validator.validationMessages.length, but that feels like a hack and doesn't provide any easy information about what changed (property or instance).
Possible solutions: Add callback methods in the ValidationController or its Validator? Publish an event?
Add the ability to associate multiple propertyNames with a Rule.
Possible solutions: Add a parameter propertyNames to satisfies(instance, propertyNames?: string[]) and change ValidationError.propertyName:string to ValidationError.propertyName: string | Array<string> (or have it always be an array). (Also change the name of the property to be plural?)
Add the ability to facilitate instance-level validation through bindings.
Possible solutions: Create a new binding like validation-errors called validation-object-errors for instance-level (rather than property-level) validation. This new binding would change behavior of the inner validate binding by causing whole object to be validated on each property change (rather than a single property). In the ValidationRenderer, RenderInstruction.object.elements would be filled-in with elements corresponding to all of the propertyNames on all the rules that fail. (Change # 2, above, comes in handy here).
The text was updated successfully, but these errors were encountered:
I'm submitting a feature request
0.12.5
any
Typescript 2.0
Current behavior:
Aurelia-Validation has some great features for validating both properties and whole instances. The property-level features seem to be more fleshed-out than the instance-level features. I am developing an application that uses instance-level validation, and would like to propose some new features that will facilitate the use of instance-level validation, and provide more flexibility to the aurelia-validation framework in general.
Feature Requests:
controller.validator.validationMessages.length
, but that feels like a hack and doesn't provide any easy information about what changed (property or instance).Possible solutions: Add callback methods in the
ValidationController
or itsValidator
? Publish an event?Possible solutions: Add a parameter
propertyNames
tosatisfies(instance, propertyNames?: string[])
and changeValidationError.propertyName:string
toValidationError.propertyName: string | Array<string>
(or have it always be an array). (Also change the name of the property to be plural?)Possible solutions: Create a new binding like
validation-errors
calledvalidation-object-errors
for instance-level (rather than property-level) validation. This new binding would change behavior of the innervalidate
binding by causing whole object to be validated on each property change (rather than a single property). In theValidationRenderer
,RenderInstruction.object.elements
would be filled-in with elements corresponding to all of the propertyNames on all the rules that fail. (Change # 2, above, comes in handy here).The text was updated successfully, but these errors were encountered: