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
This commit is contained in:
		
							parent
							
								
									6b731a067a
								
							
						
					
					
						commit
						e50c7dcc4c
					
				| @ -6,13 +6,11 @@ import { Routes, RouterModule } from '@angular/router'; // CLI imports router | |||||||
| const routes: Routes = [ | const routes: Routes = [ | ||||||
|   { path: 'first-component', component: FirstComponent }, |   { path: 'first-component', component: FirstComponent }, | ||||||
|   { path: 'second-component', component: SecondComponent }, |   { path: 'second-component', component: SecondComponent }, | ||||||
|   // #enddocregion routes
 |   // #enddocregion routes, routes-with-wildcard
 | ||||||
|   { path: '',   redirectTo: '/first-component', pathMatch: 'full' }, // redirect to `first-component`
 |   { path: '',   redirectTo: '/first-component', pathMatch: 'full' }, // redirect to `first-component`
 | ||||||
|   { path: '**', component: FirstComponent }, |   // #docregion routes-with-wildcard
 | ||||||
|   // #enddocregion redirect
 |  | ||||||
|   { path: '**', component: PageNotFoundComponent },  // Wildcard route for a 404 page
 |   { path: '**', component: PageNotFoundComponent },  // Wildcard route for a 404 page
 | ||||||
|   // #docregion routes
 |   // #docregion routes
 | ||||||
|   // #docregion redirect
 |  | ||||||
| ]; | ]; | ||||||
| // #enddocregion routes, routes-with-wildcard, redirect
 | // #enddocregion routes, routes-with-wildcard, redirect
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user