簡體   English   中英

在另一個組件的路由器出口中使用@Input顯示組件

[英]Displaying component with @Input in another component's router-outlet

我想知道你們是否知道一種顯示在路由器出口內采用@Input指令的組件的方法。

我有幾個使用@Inputs的組件,我想在一個組件中動態顯示這些組件。 我希望將這一組件容器設計為盡可能抽象,以便將來可以重用和擴展。

我正在努力實現類似

big-container.component具有

<router-outlet name='container1'></router-outlet>

在其中鏈接到container1.component,其中包含

<container1 [settings]=mySettings></container1>

我想使用[settings]將container1.component顯示在big-container.component的路由器出口中。

謝謝!

如該POST所述,當前是不可能的。

這是Github上的鏈接問題

使用共享服務與路由器添加的組件進行通信。 有關詳細信息,請參見https://angular.io/docs/ts/latest/cookbook/component-communication.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM