My code is as follows :
app component html
<app-header ></app-header>
<router-outlet></router-outlet>
<app-footer></app-footer>
routing.ts:
const routes: Routes = [
{ path: 'register', component: RegisterComponent,
children: [
{
path: 'page/:slug',component: PagesComponent,
outlet: 'bookLists'
},
]},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
component.html:
<label for="CustomerAcceptTerms" class=" control-label emaillabel">
<input type="checkbox" name="terms" value="1"id="CustomerAcceptTerms"> I
accept and understand the
<a [routerLink]="['/register',{ outlets: { bookLists: ['page/terms-and-conditions'] } }]" routerLinkActive="active">Book Details</a>
</label>
app.component.html:
<app-details></app-details>
<router-outlet></router-outlet>
<router-outlet name="bookLists"></router-outlet>
and error is:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'register'