I have the following routes in my app-routing.module.ts.
{
path: 'abc',
children: [
{
path: 'foo',
pathMatch: 'full',
redirectTo: 'foo/bar',
},
{
path: 'foo',
loadChildren: () =>
import('./features/foo/foo.module').then((m) => m.FooModule),
data: { title: 'Foo' },
},
]
}
So when I redirect myself to abc/foo in the menu for example, I would expect to be redirected to foo/bar, but instead i get stuck at foo and only on a refresh of the site it redirects me to abc/foo/bar. No console log errors, how do I debug something like that? I am using angular 10. I can see the feature module being loaded correctly when targeting the foo route.
This is my foo.module.ts:
const routes: Routes = [
{ path: 'bar', component: BarComponent},
{ path: '**', redirectTo: '' },
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class FooRoutingModule {}