vendredi 30 décembre 2016

Reset Ember Component on Button Click

Background:

I have a component inside a template. This component is a pop up box which opens on a button click. This pop up box has check boxes (all by default set to false) inside of it. When I close this pop up box I want to completely reset all of the variables to the default settings, i.e. all checkboxes are now turned off. Currently, when I re-open this popup box the previous checkboxes are still checked. How do I do this without manually toggling every checkbox:

this.set("checkbox1", false);
this.set("checkbox2", false);
so on...

Is there a function that will automatically reset the component and set it back to false?




Aucun commentaire:

Enregistrer un commentaire