Migration Guide & Breaking Changes
Creating and customing Aurelia Validation rules to ensure data is validated.
Last updated
Was this helpful?
Revision created
refactor(event): no longer call prevent default by default (#1926) BREAKING CHANGE: no longer calling preventDefault on all events, this can be switched back to v1 behavior via IListenerBindingOptions [skip ci] * BREAKING CHANGE: no longer reexport fetch plugin from aurelia package * fix(router-lite): dont register config * chore: cleanup unused methods, correct typings on test fixture
Creating and customing Aurelia Validation rules to ensure data is validated.
Last updated
Was this helpful?
This section outlines the breaking changes introduced by @aurelia/validation*
as compared to the predecessor aurelia-validation
. However, it is recommended that you read the documentation, as many new features have been added.
Instead of a single validation package, the functionalities are arranged in . These are @aurelia/validation
(provides core functionalities), @aurelia/validation-html
(provides integration with the view), and @aurelia/validation-i18n
(provides localization support for validation in view).
Usage of ValidationRules
in terms of defining rules is a bit different. The example below shows the difference. Refer to the section for the details.
Named registration of reusable custom rules is no longer supported in favor of simply using an instance of the rule implementation. The example below shows the difference. Refer to the section for the details.
The validator interface has been changed to have only one validate
method equipped with validation instructions. Refer to the section for the details.
The usage of the validation controller factory is changed. Instead of using controllerFactory.createForCurrentScope();
, you need to use the argument decorator @newInstanceForScope(IValidationController)
syntax. Refer to the section for the details.
No validation renderer in favor of ValidationResultsSubscriber
. Refer to the section for the details.