mercredi 18 mai 2016

What is the best way to presetting checkboxes in Ember.js?

I have template with checkbox

<div class="col-sm-6">
   <input type="checkbox" id="isDeletedCheckbox" />
</div>

And I have Route with

afterModel(model) {
    this.controllerFor(this.get('routeName')).set('model', model)
},

I tried to use

setupController() {
    if (this.controller.get('model').get('isDeleted')) {
        this.controller.set("isDeletedCheckbox", true);
    }
}

or

setupController() {     
   if (this.controller.get('model').get('isDeleted')) {
        $("#isDeletedCheckbox").checked(true);
   }
}

but it does not help to preset the value




Aucun commentaire:

Enregistrer un commentaire