0
应用程序工作正常使用platform-browser
的时候,但在服务器不工作,抛出下面的错误在服务器控制台“找不到主出口”单独的模块app.routing.module.ts
:角度使用时,平台的服务器,
const routes: Routes = [
{
path: '',
component: MainComponent,
resolve: {
categoryLists: CategoriesResolver
},
children: [
{ path: '', pathMatch: 'full', component: HomeComponent}
]
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
providers: [CategoriesResolver]
})
export class AppRoutingModule { }
app.component.html
:
<div>
<router-outlet></router-outlet>
</div>
我在'MainComponent'中实际上有' router-outlet>',它可以在'platform-browser'下正常工作。 –
所以'app.component.html'中有''router-outlet',还有'main.component.html'?有没有可能隐藏它们的'* ngIf'? – trichetriche
是的,确切地说。 不,没有* ngIf。我想知道为什么它不工作**只有平台服务器**。 –