How to access query parameters from route in Ember 1.7

后端 未结 5 488
傲寒
傲寒 2020-12-16 12:08

In 1.7 Ember should support Query Parameters. I have no problems using them in controller but I\'d like to access them in Route, ideally in beforeModel hook but model hook w

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-16 12:42

    Pretty sure it's a bug, but you can access them in the meantime via the transition object:

    App.ApplicationRoute = Em.Route.extend({
       beforeModel: function(transition){
           console.log(transition.queryParams.test);
       }
    }
    

提交回复
热议问题