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。我想知道爲什麼它不工作**只有平臺服務器**。 –