Child, nested, redirect and wildcard routes
Learn Child, nested, redirect and wildcard routes (Module 10 · Angular Routing, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Child routes, redirects and not-found pages • Child routes are routes inside a parent route's children array. The parent component (a layout with a menu) contains its own <router-outlet> where the child appears: these are nested routes . Think of a house (parent) with rooms (children). • A redirect route sends one URL to another: { path: '', redirectTo: 'home', pathMatch: 'full' } . • A wildcard route path: '**' matches anything left over; use it for the 404 Not Found page . • Route ordering : the router takes the first match, so put specific routes first and the wildcard last.