0

I have an app, the app has a router for the main part of the page and another router for a chat. In my app.routing:

const routes: Routes = [
  {
    path: 'start',
    canActivate: [AuthGuard],
    loadChildren: () =>
      import('./pages/start.module').then((m) => m.StartModule),
  },
  { path: 'login/:place', component: AuthComponent },
  { path: 'public/:id/:token', component: PublicComponent },
  { path: '404', component: NotFoundComponent },
  { path: '', redirectTo: 'login/admin', pathMatch: 'full' },

  { path: '**', component: NotFoundComponent },
];

in mi start.routing:

const routes: Routes = [
  {
    path: '',
    canActivate: [AuthGuard],
    component: SidenavComponent,
    data: { title: 'start' },
    children: [
      {
        path: 'modulos/:module',
        canActivate: [AuthGuard],
        loadChildren: () =>
          import('./modulos/modulos.module').then((m) => m.ModulosModule),
      },
      {
        path: 'msg',
        canActivate: [AuthGuard],
        loadChildren: () =>
          import('../components/comunication/chat/chat.module').then(
            (m) => m.ChatModule
          ),
        outlet: 's',
      },
    ],
  },
];```

and in my start.html:


<button [routerLink]="['start',{ outlets: { s: ['msg'] } }]" >chat

<router-outlet></router-outlet>

  <div>
    <router-outlet name='s'></router-outlet>
  </div>
I click on the button to navigate at chat I get the following error:


Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'msg' Error: Cannot match any routes. URL Segment: 'msg'


I thank you for your help


I have an app in Angular 10, the app has two router-outlets. The first router-outlet is for the main part of the page and another router for a chat. but When I click on the button to navigate at chat I get the following error:

Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'msg'
Error: Cannot match any routes. URL Segment: 'msg'
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 06 '23 at 17:29

0 Answers0