举例,当访问没有指定页面地址的路径时,让它转到指定页面
const routes: Routes = [
{path: ``, redirectTo: `/home`, pathMatch: `full`},
{path: `home`, component: HomeComponent},
];
当用户访问 http://localhost:4200
举例,当访问没有指定页面地址的路径时,让它转到指定页面
const routes: Routes = [
{path: ``, redirectTo: `/home`, pathMatch: `full`},
{path: `home`, component: HomeComponent},
];
当用户访问 http://localhost:4200