I'm having a problem with bindable variables and jQuery plugins that manipulate the input value. I tested the following code and found that Aurelia does not listen for changes in values made by $.fn.val
:
<template>
<input id="my-input" value.bind="inputvalue" type="text">
</template>
class MyClass {
@bindable inputvalue;
constructor() {
this.inputvalue = 'First value'
}
bind() {
setTimeout(() => {
$('#my-input').val('Some value').change();
// No input o valor é 'Some value',
// mas na variável bindable this.inputvalue o valor ainda é 'First value'
}, 4000);
}
}
Do you have any way to solve this problem?