Make two-way binding default on a custom bindable

Say I have a custom component with a @bindable val. Is it possible to make it so that if someone uses by component and adds val.bind that the .bind will default to two-way binding like it does with form components?

2 Likes

Hi @djedi,
https://aurelia.io/docs/templating/custom-elements#bindable-properties

  import {bindable, bindingMode} from 'aurelia-framework';
  
  export class SecretMessageCustomElement {
    @bindable({ defaultBindingMode: bindingMode.twoWay }) value;
4 Likes