ember.js - adding / removing a class from an ember input -


using ember 1.0 , handlebars 1.0

i want present ember input disabled until user presses edit button. have managed functionality working @ expense of code duplication.

{{#if isediting}}   {{input type="text" value=firstname class="form-control" placeholder="first name" }} {{else}}   {{input type="text" value=firstname class="form-control" placeholder="first name" disabled=""}} {{/if}} 

just wondering if there better way ..

thanks

instead of disabled input classes, add disabled attribute input field

{{input type="text" value=firstname class="input-medium" disabledbinding="disabled"}} 

demo fiddle


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -