mercredi 2 août 2017

How to remove class from other elements in emberjs

my functions toggles the class name on click to an element. But It's not remove the class names from other elements. so all elements are highliting now. But whenever user click on an element, it should have the classname rest of siblings has to removed the classname how do do this?

here is my try but not works:

import Ember from 'ember';

export default Ember.Component.extend({
    isSelected : false,
    deSelectOthers : function(){
        this.set( "isSelected", false ); //deselecting all before add the class to clicked element
    },

    actions : {
        selectCard : function(card) {
            this.deSelectOthers(); //de select others not works
            this.toggleProperty('isSelected'); // add class to this element only works. how to remove class from other element?
        }
    }
});




Aucun commentaire:

Enregistrer un commentaire