How to modify parameters at beforeModel?


#1

I am checking a parameter if it exist or not , and if not exist i want to fill it up and so at the model hook , , model(params){} is fulfilled with parameters.

Would like to know if it is possible to modify ? i try to modify beforeModel(transition) { transition.queryParamer.location = "lat,lng"} but it dosen’t really effect model(params){}

Regards.


#2

Why not just do this in the model hook? E.g.:

model(params) {
  let location = Ember.get(params, 'location') || 'myDefaultLocation';
  // do something
}

#3

Thanks i finally end up doing at model hook :smiley: