-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
ERROR: router cannot match any routes in child component named router-outlet #14896
Comments
any updates or suggestions? can't figure it out how to get this to work. or is this by design? |
same for me, not working. |
@denisyilmaz Hi, not sure if this is the same issue, but might be worth a look, just in case. The routerlink syntax wasn't behaving as I had initially expected. |
actually changing the router-link to adding the /en in <a [routerLink]="[ -->'/en', <-- {outlets: {side_menu: ['imprint']}}]" title="show Sidemenu in named router-outlet">Show Sidemenu</a> get the auxiliary route to work. but I don't understand why this would be necessary? as the router-link is already in the active component (PageComponent) and showing the correct path --> shouldn't both solutions work? |
i would have thought so. which is why I created that stackoverflow question. documentation isn't very great for angular's secondary routing. i did pick up Victor Savkin's (the creator of the angular router) book "Angular Router", hopefully that helps. |
Closing as resolved. |
well it was not resolved it just have a workaround currently i'm facing a similar behavior, mi problem is that my routes are more dynamic so i can't just write my current route + the inner outlet |
not resolved...there should be a way to have a fallback for not found outlets. |
most probably this will only fails when using lazy loading, because router is not determining exactly where it's at the moment, however i was able to continue after using the property relativeTo, to the current route (ActivatedRoute), as i wrote before, my problem was that where i was planning to use the second router i have a dinamic param which will not allow me to set the route manually as @denisyilmaz did in his comment, after several expended hours this was the only workaround i found, not sure if will possible to make a fix for this, but seems to be more complicated than what i thought at the beggining |
It's also gonna fail if you have multiple angular applications on a single app. Which was my case. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
I have a module with two router-outlets. The main outlet and one named 'side_menu'.
In the module I have following routes:
when navigating to
example.com/en/imprint
the app correctly activates PageComponent with MainComponent in the router-outlet and SideMenuComponent in the "side_menu" router-outlet.But: when I navigate for example to
example.com/en/anypage(side_menu:imprint)
I get Error: Cannot match any routes. URL Segment: 'imprint'Expected behavior
That I can show the "side_menu" router-outlet no matter which other views are currently active.
Minimal reproduction of the problem with instructions
http://plnkr.co/edit/e8lUPmvni1LgWCKilz6t?p=preview
What is the motivation / use case for changing the behavior?
having an overlay that can be displayed and hidden based on params and without changing the current visible main view
Please tell us about your environment:
macOS Sierra, Visual Studio Code, Safari, Chrome
Angular version: 4.0.0-rc.1
Angular Quickstart Master Seed updated to @angular ">=4.0.0-beta <5.0.0" and typescript "~2.1.0"
Browser:
tested in Chrome & Safari
The text was updated successfully, but these errors were encountered: