In app.route configuration we have the following routes:
{
path: 'homedetails',
loadChildren: '../app/home/home-details/home-details.module#HomeDetailsModule',
data: { preload: true, paramKey: 'homekey', paramType: 'number' },
canActivate: [ParamsGuard]
},
In lazy loaded modules Home Details route have
const routes: Routes = [{
path: '',
component: HomeComponent,
// canActivate: [AuthGuard],
children: [
{
path: 'Home-properties',
loadChildren: '../../../app/Home/Home-details/Home-property/Home-property.module#HomePropertyModule',
},
{
path: 'access',
component: AccessComponent,
resolve: { 'info-message': InfoMessageResolver }
},
{
path: '',
redirectTo: 'access',
pathMatch: 'full'
}
],
}];
Issue is when homedetails path load the lazy loaded module it always navigate to default path 'access' as per business requirement need to load the home-properties instead of default 'access' path.
Load Children always load the default navigation instead of provided routes.
Appreciate any suggestion and solution.
First of all, you should put your redirect as the first route. Secondly, you are redirected to
accessroute because you specified it in your routeAs you mentioned
accessis the default path, obviously it will go to that route because it's an empty children path. If you really want to go toHome-propertiesroute then that should be your redirect path