EmberSherpa / ama

Ask me anything Ember!
22 stars 0 forks source link

Ember Click on Radio Button #19

Open aalasolutions-zz opened 8 years ago

aalasolutions-zz commented 8 years ago

Using Ember-CLI 1.13.1. I have two radio buttons on the page

{{input type="radio" name="order_size_type" id="order_size_in_cm" checked=true}}
<label for="order_size_in_cm" {{action 'showFieldsCM' preventDefault=false}}>Cm</label>
{{input type="radio" name="order_size_type" id="order_size_in_ft"}}
<label for="order_size_in_ft" {{action 'showFieldsFT' preventDefault=false}}>Ft/In</label>

I have created two functions which simple add the hide class based on what label is clicked

There are two questions

  1. By default no radio box is checked, even I have checked=true
  2. action is applied on the Label, and it is working but when I apply that on radio it is not working

So right now I have to click the label to hide/show the content

aalasolutions-zz commented 8 years ago

I am using Ember 1.13.5

taras commented 8 years ago

@zinyando Please create an Ember Twiddle that shows how to bind value of radio elements with Ember 1.13+.