1.0.0-beta.1.0.0
EisenbergEffect
released this
09 Dec 03:52
·
160 commits
to master
since this release
breaking changes
ValidationError
class renamedValidateResult
. PreviouslyValidationError
represented a broken rule. NowValidateResult
represents the result of evaluating a rule and the pass/fail status is stored in a new boolean property namedvalid
.RenderInstruction
, which is the argument passed to validation renderers, now recievesValidateResult
s instead ofValidationError
s. This means you'll need to skip rendering results whosevalid
property istrue
OR you'll need to add logic to render "success". Examples of both are in the docs.- The
ValidationController
'svalidate
method has a new return type. Previously it wasPromise<ValidationError[]>
. Now it'sPromise<ControllerValidateResult>
. This means you'll need to change code like this:
js controller.validate().then(errors => { if (errors.length === 0) { // valid :) } else { // invalid :( } });
To something like this:
js controller.validate().then(result => { if (result.valid) { // valid :) } else { // invalid :( } });