Compile Error if is not a modifier: Helpers may not be used in the element form

I in my template the line below

<button class="button is-primary is-fullwidth" {{if isButtonDisabled "disabled"}} disabled={{isButtonDisabled}}>Activate Now</button>

I have the property isButtonDisabled set in my controller. But i keep getting the error:

ember.debug.js:26513 Error: Compile Error if is not a modifier: Helpers may not be used in the element form.
    at ember.debug.js:4760
    at Compilers.compile (ember.debug.js:4729)
    at compileStatement (ember.debug.js:4172)
    at ember.debug.js:3822
    at Array.forEach (<anonymous>)
    at WrappedBuilder.compile (ember.debug.js:3821)
    at ComponentLayoutBuilder.compile (ember.debug.js:3765)
    at compileLayout (ember.debug.js:3746)
    at Cache._emberMetal.Cache.owner [as func] (ember.debug.js:16336)
    at Cache.get (ember.debug.js:24925)

Ember CLI 2.14.1

Please what are mine doing wrong?

1 Like

It seems your if is wrong. See Conditionals - Templates - Ember Guides

1 Like

<button class="button is-primary is-fullwidth {{if isButtonDisabled 'disabled'}}" disabled={{isButtonDisabled}}>Activate Now</button>

This will work.