在创建路由时,我相信我们会创建类型为Routes
的数组,并将其传递给forRoots
的{{1}}方法。但是RouterModule
似乎期望forRoot
,而不是Route
。为什么Angular不抱怨?
Routes
的类型为AppRoutes
Routes
但是RouterModule的 const appRoutes: Routes = [
{ path: 'crisis-center', component: CrisisListComponent },
{ path: 'hero/:id', `enter code here` component: HeroDetailComponent }];
期望forRoot
Route[]