dimanche 30 septembre 2018

Toggling between true and false

import Component from '@ember/component';

export default Component.extend({
  hello: true ,

  actions:{
      switch: function(hello){
        if(hello = false){
        this.set('hello', true);
      }else {
        if(hello = true){
          this.set('hello', false);
        }  
      }

I'm trying to toggle between the false and true options however this always returns false. I need it so that it switches between the two depending on the its current value.

    }
  }
});




Aucun commentaire:

Enregistrer un commentaire