samedi 25 juin 2016

Emberjs "eq" in component

Got a component that works just fine as follows (selectedId is definitely set):

export default Ember.Component.extend({
    store: Ember.inject.service(),
    items: [],
    selectedId: 0,
    result: '',
    init () {
        this._super(...arguments);
        var store = this.get('store'); 
        let items =  store.findAll('dealtype');
        this.set('items', items);
    },
    didInsertElement: function() {
       // this.$().select2();
     }
});

This render my component fine, but the part it never goes to true for the if statement (installed ember-truth-helpers for that)

<select style="width:100%">
    <option value=""></option>
    
        
            <option selected="selected" value=""> YEAH</option>
        
            <option  value="">  </option>
        
    
</select>

Don't want to mix problems, but as you see i commented out the select2 init call. When doing that it make my select a select2 list, but the items are gone (thought still in the markup)




Aucun commentaire:

Enregistrer un commentaire