[英]Make a component render in more than one page - Routes Angular 13
我有以下路由,我需要在某些特定路由中渲染條件組件,但在所有路由中渲染共享組件。 我該怎么做?
const routes: Routes = [ { path: "someroute", component: ConditionalComponent,
孩子們:[{路徑:'',組件:SharedComponent}],
} ];
如果我正確理解了這個問題,你應該能夠擁有
const routes: Routes = [
{
path: "someroute",
component: ConditionalComponent
}
];
在你的 app.component.html 你應該有
<router-outlet></router-outlet>
<shared-component></shared-component>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.