-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this.paramsFor(routeName) with the routeName of a route not previously visited #13771
Comments
Can you please try to replicate the bug in a Twiddle, please. Thank you! |
Hallo @Serabe, See first part of a twiddle reproduction here . Try URL:
Any proposals about how to avoid the transition in
|
@fknoll is the |
Hello, @fknoll: I cannot see any Thank you! |
@fknoll have you reached out in the #-help channel of the embercommunity.slack.com chatroom? I'm curious if this may be more of a support need than an Ember bug. |
Just returned from a short vacation - I apologize for lack of responsiveness. I insist on my initial finding: using I have created this reproducible scenario on Ember Twiddle: Look for this code in
|
@pixelhandler Thank you so much for your input - it is appreciated. I understand your proposal! Yes, it might be a simple and usable workaround just to avoid my default transition in |
@fknoll can the
I'm curious, perhaps I should not expect to have the 'params' available from a controller that was "not previously visited". Looking up the params in the application route for the params for a controller in a child route that has not been visited yet seems like an issue on the subject of "putting the cart before the horse". Which is why I suspect that there is perhaps a different implementation for your use case.
What about using the |
… which could trigger _qpChanged
Anybody willing to take a look at the test for this? The code change fixes the issue in above twiddle example. |
@fknoll we discussed this issue a bit an the bottom line is… if a route hasn't been visited, it doesn't have |
The docs need clarity, see http://emberjs.com/api/classes/Ember.Route.html#method_paramsFor This issue is more of a documentation issue |
Improve documentation on `Route.paramsFor`. Fixes emberjs#13771
@Serabe @pixelhandler @dguettler Thank you to all of you for investigating into this problem of mine. @pixelhandler, I do understand your position. Nevertheless, I find it unacceptable that an Ember application stops working after using Besides, I am still challenged by my original quest: At default start-up (e.g. Thus, I am looking for a way to detect, that I am not dealing with a default start-up, but instead by a start-up initiated by specific none default URL request. |
Hello, @fknoll: We took some time to get to know how The documentation problem is being addressed in #14034. If I had to redirect all the users getting to my app at the root level (let's say Please, for questions on how to use the framework for your specific needs, use the Thank you! |
@Serabe - Thank you :-) |
Reopening this to track the documentation issue. |
Improve documentation on `Route.paramsFor`. Fixes emberjs#13771
Improve documentation on `Route.paramsFor`. Fixes emberjs#13771
@Serabe @pixelhandler I have an use case where I am setting queryParams of route which is not visited yet and then visiting the route(after some action has happened), which crashes the app. The below code in the beforeModel hook of the route fixes this:
I know I am not supposed to change the private methods of controller, but I am unable to understand why this error is occurring. Someone please shed some light on this. Related to #11592 |
Using
It seems like using
this.paramsFor(routeName)
with the routeName of a route not previously visited makes my application fail - not immediately, but later on, when I transition to the route.When starting my application, I want automatically to show a specific route
reg
directly nested under theapplication
route.For route
reg
I have defined two query parameters -queryParam1
andqueryParam2
.In the
model()
method forapplication
route the default values for those two query parameters are found and saved indefaultQueryParam1
anddefaultQueryParam2
.To secure that the navigation to route
reg
is not already requested via the urlhttp://localhost:4200/reg?queryParam1=xxx&queryParam2=yyy
, I am testing for the existence of the query parameter values before requesting the default transition toreg
.For that purpose I have defined
When using the url
http://localhost:4200/reg?queryParam1=xxx&queryParam2=yyy
, everything seems to work nice and smoothly.However, when I use the default start application url
http://localhost:4200/
I get this two fatal errors:The text was updated successfully, but these errors were encountered: