7
votes

We are getting an error Uncaught TypeError: Cannot read property 'yield' of undefined for the following hbs code;

<button {{if isButtonEnabled 'enabled' 'disabled'}}>Test</button>

isButtonEnabled is a property defined on my corresponding controller

1
Can you reproduce the error in Ember Twiddle and add a link to your question? - locks
What Ember versions? - user663031

1 Answers

11
votes

You'll have to flip your condition and do this. I just had this exact problem and this was the solution.

<button disabled={{isButtonDisabled}}>Test<button>