lundi 9 novembre 2015

How to listen selection change of dropdown and set the default selected value using ember2.0?

I have created the dropdown of country name and setted country code as a value for each option .I want to set the default country and also the listen the selection change of the dropdown .I have tried the following code

HTML

<select class="left-float" onchange={{action selectionchange}}>
  {{#each model.countries as |country|}}
   <option value="{{country.code}}" value={{eq country.code "IN"}}>{{country.name}}</option>
 {{/each}}
</select>

Router

App.SignupRoute = Ember.Route.extend({
  model: function () {            
    return Ember.RSVP.hash({
        countries: Countries
    });
},
actions:{
selectionchange:function(value){

}
}
});

Could please help me to resolve this




Aucun commentaire:

Enregistrer un commentaire