Bind more controller properties to one attribute using HTMLBars

68 Views Asked by At

is this correct or is there any other solution?

<input disabled={{model.isnValid}} disabled={{isSaving}}>

I know that I can create new CP and depend on model.isnValid and isSaving, but I want to know if there is any other solutions.

Thank you for advices

1

There are 1 best solutions below

0
On BEST ANSWER

Using a computed property is probably best here. Another potential solution is ember-truth-helpers which would allow you to write code such as:

<input disabled={{or model.isInvalid model.isSaving}}>

I use ember-truth-helpers a lot, but that just looks weird and I wouldn't recommend it.