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
If code is bundled with webpacks, and later on we decided id is not a required field, we need to make code changes by removing .required() on a property and rebundle with webpack and deploy it
Expected/desired behavior:
Consider I have a REST CONTROLLER which says if that is required or not. Based on a value of a key I would like to dynamically set id as required or not required.
if the controller returns as below json, I would like id to be required:
id:{
required:true;
}
if the controller returns as below json, I would like id to be not required:
id:{
required:false;
}
I've already implemented a service which does that for me, Can I know how to achieve this on UI with Aurelia-Validation framework.?
The text was updated successfully, but these errors were encountered:
//someother validations written here like as shown
ValidationRules
.ensure('cid').displayName('Company ID').required().then().matches(/^[a-zA-Z]{1}/).withMessage('${$displayName} should always start with alphabet').then().matches(/^[a-zA-Z]{1}[a-zA-Z0-9]*$/).withMessage('Spaces and Special characters are not allowed.').then().minLength(this.companyCidMin).maxLength(this.companyCidMax).on(this.selectedItem);
Rule definition has a fluent interface, so every step can be saved into a variable. Note also that on can be applied to an object only once; doing it multiple times will just overwrite the current rules.
Code Sample:
ValidationRules
.ensure('id').displayName('ID').required().then().
Current behavior:
If code is bundled with webpacks, and later on we decided id is not a required field, we need to make code changes by removing .required() on a property and rebundle with webpack and deploy it
Expected/desired behavior:
Consider I have a REST CONTROLLER which says if that is required or not. Based on a value of a key I would like to dynamically set id as required or not required.
if the controller returns as below json, I would like id to be required:
id:{
required:true;
}
if the controller returns as below json, I would like id to be not required:
id:{
required:false;
}
I've already implemented a service which does that for me, Can I know how to achieve this on UI with Aurelia-Validation framework.?
The text was updated successfully, but these errors were encountered: