That is not what I want, I have not add param for Normal Login, why did I get that param?
Seems it is cached in somewhere, but I can not find it in the guide.
I am referring to:
How to clear the query param? Can anyone help me? Thanks
Thx, yes that works. But there are many login entry point in our project and many teams work on login. I can not ask them to manually set the flag one by one. The thing is there are many Normal Login entry, but only one Quick Login entry point, is there any other better solution I can pass parameter to login controller?
Though I would caution that perhaps queryParams is not the best fit in this case. Maybe a different route or possibly a component that knows how to construct the link-to appropriately?
In any case the fast solution is what @raytiley suggested.
Hi, I am running into this too. It’s pretty frustrating cause the work around is to add the parameter to all calls. I would expect that if I don’t send a query param, I don’t get that query param. I would not expect the route to save the query param.
Routes saving query parameters is a result of controllers (where the query parameter values actually live) being singletons (much like services). One of the best ways to handle this if you want the query parameters cleared when leaving a route is to set the query parameters back to default values when exiting the route: Route - 3.21 - Ember API Documentation
I understand that, and unfortunately, that’s what we’ll be forced to do. But I think the use case where you want to preserve queryparams is few and far between.
Is there any reason that Ember couldn’t just stop preserving them? Don’t store them in state, or automatically clear them for us. At least make that behavior configurable so we’re not forced to manually clear every query parameter that could ever be called for a page. Imagine if someone decided to have a dynamic set of queryParams too… that would be a nightmare to manage.
I think preserving query params is a sensible default, but I agree it would be nice if there was an easier way to clear them. Really I think the problem is that query params have long been in need of some TLC and I believe they are being prioritized for a redesign in the near future. In the meantime you can check out ember-query-param-service. Not sure if it will help with your use case specifically but it might make managing QPs a little easier.