I’m using Ember 3.4. I have a variable which becomes true on a button click. I have also included loading.hbs file in my app.
In dummy.hbs file:
<button {{action "reload"}}>Refresh</button>
Variable:{{dummyVar}}
<button {{action "setToTrue"}}>Change To True</button>
In controller file dummy.js:
setToTrue() {
this.set("dummyVar", true);
},
reload() {
this.send("reloadDetails");
}
In route File dummy.js:
resetController(controller, isExiting) {
this._super(...arguments);
if (isExiting) {
//isExiting would be false if only the route's model was changing
controller.set("dummyVar", false);
}
},
actions: {
reloadDetails() {
this.refresh();
}
}
When I click the button setToTrue, the value changes to True and it is displayed. But when I click refresh button, The variable “dummyVar” is set to false. The variable “dummyVar” should be changed to false only when “isExiting” is true. My question is When this.refresh is called, will the “isExiting” changed to “true” ? When I tried refreshing without creating loading.hbs, isExiting was “false”
Is this the actual behavior? Will Loading.hbs affect the isExiting value??
I have attached a twiddle link demonstrating the above problem https://ember-twiddle.com/9d5cd52ccdab66c31b5b5db62602a8d7?numColumns=2&openFiles=templates.with-loading.exiting%5C.hbs%2Ctemplates.without-loading.exiting%5C.hbs
1 post - 1 participant