From e50c7dcc4c11a61a63b8234cc9649cad7584ee76 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 14 May 2020 21:38:07 -0600 Subject: [PATCH] docs(router): get rid of unnecessary line in wildcard route example and fixing wildcard docregions (#37127) The wildcard example leads to display a 404 page with the PageNotFoundComponent. But before, there is a wildcard to redirect to the FirstComponent and because of the routes order the FirstComponent will be displayed; which it is not the target of the wildcard route example code. Also, fixing some wildcard docregions PR Close #37127 --- aio/content/examples/router/src/app/app-routing.module.8.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/aio/content/examples/router/src/app/app-routing.module.8.ts b/aio/content/examples/router/src/app/app-routing.module.8.ts index 7186ced298..f5334003f5 100644 --- a/aio/content/examples/router/src/app/app-routing.module.8.ts +++ b/aio/content/examples/router/src/app/app-routing.module.8.ts @@ -6,13 +6,11 @@ import { Routes, RouterModule } from '@angular/router'; // CLI imports router const routes: Routes = [ { path: 'first-component', component: FirstComponent }, { path: 'second-component', component: SecondComponent }, - // #enddocregion routes + // #enddocregion routes, routes-with-wildcard { path: '', redirectTo: '/first-component', pathMatch: 'full' }, // redirect to `first-component` - { path: '**', component: FirstComponent }, - // #enddocregion redirect + // #docregion routes-with-wildcard { path: '**', component: PageNotFoundComponent }, // Wildcard route for a 404 page // #docregion routes - // #docregion redirect ]; // #enddocregion routes, routes-with-wildcard, redirect