router-outlet 没有呈现页面的问题.
App.模块导入RouterModule和RouterOutlet.
App-routing.mode.ts由以下代码组成.
`const routes: Routes = [
{ path: 'home', component: HomeComponent },
{ path: '', pathMatch: 'full', redirectTo: 'home' },
];
export default routes;
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})`
当我输入app.Component.html时,问题就出现了.它抛出一个错误,说明
"Error: NG05100: Providers from the `BrowserModule` have already been loaded. If you need access to common directives such as NgIf and NgFor, import the `CommonModule` instead."
我可以链接到app-home组件,它工作得很好.我遗漏了什么?