配置路由

app-routing.module.ts

  1. const routes: Routes = [
  2. { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
  3. { path: 'dashboard', component: DashboardComponent }
  4. ];

添加路由出口

  1. <router-outlet></router-outlet>

添加路由链接

  1. <a routerLink="/dashboard">Heroes</a>
文档更新时间: 2019-05-05 11:47