
This rewrite changes headings to focus on user tasks rather than features, verifies that content is up-to-date and complete, removes colloquial phrases, adds prerequisites, and expands on a task-based section in the beginning (a quick reference). PR Close #35566
29 lines
770 B
TypeScript
29 lines
770 B
TypeScript
// #docplaster
|
|
import { NgModule } from '@angular/core';
|
|
import { Routes, RouterModule } from '@angular/router'; // CLI imports router
|
|
|
|
// #docregion child-routes
|
|
const routes: Routes = [
|
|
{ path: 'first-component',
|
|
component: FirstComponent, // this is the component with the <router-outlet> in the template
|
|
children: [
|
|
{
|
|
path: 'child-a', // child route path
|
|
component: ChildAComponent // child route component that the router renders
|
|
},
|
|
{
|
|
path: 'child-b',
|
|
component: ChildBComponent // another child route component that the router renders
|
|
}
|
|
] },
|
|
// #enddocregion child-routes
|
|
|
|
|
|
@NgModule({
|
|
imports: [RouterModule.forRoot(routes)],
|
|
exports: [RouterModule]
|
|
})
|
|
export class AppRoutingModule { }
|
|
|
|
|