mardi 3 mars 2015

Ember.js controller variables reseting after page refresh

Using Ember.js:


I have a Route



App.QueryDataRoute = Ember.Route.extend({
model: function(params) {
return Ember.RSVP.hash({
propertyObject: this.controllerFor("cres").get("properties").findBy('title', params.propertytype_title),
nrOfOffers: this.controllerFor("queryData").get("nrOfOffers"),
deal: this.controllerFor("queryData").get("deal"),
price: this.controllerFor("queryData").get("price"),
surface: this.controllerFor("queryData").get("surface"),
});
}
});


All those .get('[variable name]') are variables inside QueryData controller.


PROBLEM: After page refresh I lose those variables ofcourse because they are declared as null again inside the controller.


QUESTION: How can I not reset the variables inside the contorller after page refresh so that I can load them again from Route.





Aucun commentaire:

Enregistrer un commentaire