lundi 3 avril 2017

Emberjs destroying component from the DOM from component code only

I have created an emberjs component, which has a template and some code in js file. I want to remove that component from DOM and also want to remove all of it's events on some condition. How can I achive this ? or any similar way to achive the same ?

//app/pods/custom-comp/component.js
import Ember from 'ember';

export default Ember.Component.extend({
    didInsertElement() {
       if(some_condition) { //if this condition is true then destory the component from DOM and remove all of its events.
          //destroy the component
       }
    }
});




Aucun commentaire:

Enregistrer un commentaire