-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed as not planned
Labels
area: routerrouter: directivesRouterLink, RouterLinkActive, RouterOutlet etc.RouterLink, RouterLinkActive, RouterOutlet etc.
Milestone
Description
Which @angular/* package(s) are the source of the bug?
router
Is this a regression?
No
Description
I use the router to have different layouts applied to different sections of my app. Therefore I have e.g. a route "with-frame" and children below it like this:
const routes: Routes = [
{
path: 'with-frame',
component: LayoutComponent,
children: [
{ path: '', redirectTo: 'container-queries/dashboard', pathMatch: 'full' },
{ path: 'container-queries/dashboard', component: DashboardComponent },
{ path: 'css-grid/dashboard', component: DashboardCssGridComponent }
]
}
];
With this construct multiple routes are marked as active (as you can see in my demo repo).
For reproduction:
- Get the demo repo
- Execute npm i
- Execute npm start
Please provide a link to a minimal reproduction of the bug
https://github.com/MeMeMax/router-link-active-bug
Please provide the exception or error you saw
No exception. Just wrong behaviour as seen in the reproduction demo. When initially opening the app multiple routes are marked as active in the top navigation. When I click around, they disappear as I visit every route once.
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 17.1.0
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: routerrouter: directivesRouterLink, RouterLinkActive, RouterOutlet etc.RouterLink, RouterLinkActive, RouterOutlet etc.