How to leave a radiobutton marked as default on ember

2

I have these two components radio-button . I would like to set% checked / checked as default. How do I do this in EmberJS?.

<div>
  <label>Pessoa Física</label>
  {{radio-button
    id="classificacao-pessoa-is-fisica"
    radioClass="classificacao-pessoa-is-fisica" 
    groupValue=classificacao.pessoa.tipo
    value='FISICA'
  }}
</div>
<div  class="col-sm-12 text-right">
  <label>Pessoa Jurídica</label>
  {{radio-button
    id="classificacao-pessoa-is-juridica"
    radioClass="classificacao-pessoa-is-juridica"
    groupValue=classificacao.pessoa.tipo
    value='JURIDICA'
  }}
</div>
    
asked by anonymous 30.06.2017 / 18:45

2 answers

2

Just add the classificacao property to your controller or component

import Ember from 'ember';

export default Ember.Controller.extend({
  .
  .
  .
  classificacao: {
    pessoa: {
      tipo: 'FISICA'
    }
  }
});

See the example at: link

    
03.07.2017 / 16:16
0

Try adding

checked="checked"

Only the radio you want

    
30.06.2017 / 18:50