I have something like this:
inputs = {
make: {
options: [...],
value: '-1'
},
model: {
options: [...],
value: '-1'
}
}
validationRules
.on(this.inputs.make)
.ensure('value')
.required()
.satisfies(value => value !== '-1')
.on(this.inputs.model)
.ensure('value')
.required()
.satisfies(value => value !== '-1')
<div repeat.for="input of inputs | keys">
<select value.bind="inputs[input].value & validate" >
<option repeat.for="option of inputs[input].options" value.bind="option.value">
${option.text}
</option>
</select>
</div>
They when the user click a button this is called:
async validate() {
const result = await this.validationController.validate()
if (result.valid) {
console.log('Yeahhh')
}
}
However, the rules don’t seem to get applied and the result is always valid. Any thoughts?