Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Dynamically build Aurelia Validation rules.
//This is a rough attempt at dynamically building validation rules based on a JSON document.
let rules = [];
Forms[this.viewing].map(field => {
if(field.required && !field.viewIf){
if (field.required && field.viewIf) {
.when(val => this.currentDoc[field.viewIf] === field.viewIfValue)
"fieldDescription": "Dashboard Link",
"fieldType": "link-field",
"propName": "dashboardLink",
"viewIf": "previousProperty",
"viewIfValue": true,
"required": true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.