I'm using angular 6 and I want to create modal with route, to do this i use router outlet named but when i try to go on the route of the modal an error message is coming :
Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'profile' Error: Cannot match any routes. URL Segment: 'profile'
My 2 router outlet are in the same location
export const routes: Routes = [
{
path: '', component: LayoutComponent,
canActivate: [AuthenticationGuard, AuthorizationGuard],
canActivateChild: [AuthenticationGuard, AuthorizationGuard],
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'deals',
},
{
path: 'deals',
component: DealsComponent,
},
{
outlet: 'modal',
path: 'profile',
component: ProfileComponent,
data: {
title: 'My Profile',
sidebar: {
category: 'profile',
text: 'My Profile',
icon: 'person',
},
}
},
I'm using [routerLink]="['', {outlets: { modal: 'profile' } } ]"
to go on the link.
I made a working exemple of the issue : https://stackblitz.com/edit/angular-asicvf
Do someone can help me pls? Thanks