mardi 25 mai 2021

Emberjs Textarea 2 way binding with data that needs to be a getter

I am using Emberjs Textarea which has 2 way binding with the @value attribute.

The data I am passing into the value is from an argument and therefore needs to be return from a getter before I can use it in the template.

My question is how do I use 2 way binding with a getter. I keep on getting error messages stating that Cannot set property inputText of #<InputComponent> which has only a getter

I have tried to use and tried to create a setter for the getter but nothing has worked.

The post requests actually work but I still get those annoying errors in the console.

// Component JS    
get inputText() {
  return this.args.text;
}

// Component Template

<Textarea @value= @focusOut= />



Aucun commentaire:

Enregistrer un commentaire