我有多个命名的插座和 routerLinks 来为 Angular2 组件中的其他组件提供插座。
<p><a [routerLink]="['1/1', {outlets: {'articlesOutlet1': ['article'],'articlesOutlet2': ['news'] }}]"> Provide outlets 1/1</a></p>
<p><a [routerLink]="['1/2', {outlets: {'articlesOutlet1': ['article'],'articlesOutlet2': ['news'] }}]"> Provide outlets 1/2</a></p>
<p><a [routerLink]="['1/3', {outlets: {'articlesOutlet1': ['article'],'articlesOutlet2': ['news'] }}]"> Provide outlets 1/3</a></p>
<div class="flex-container">
<div class="flex-item"><router-outlet></router-outlet></div>
<div class="flex-item"><router-outlet name="articlesOutlet1"></router-outlet></div>
<div class="flex-item"><router-outlet name="articlesOutlet2"></router-outlet></div>
</div>
当应用程序启动第一个链接的 href 时
/articles/1/1/(articlesOutlet1:article//articlesOutlet2:news)
点击这个链接后,它的href变成了
/articles/1/1/(1/1/(articlesOutlet1:article//articlesOutlet2:news)//articlesOutlet1:article//articlesOutlet2:news)
这是一个糟糕的链接。我不想改变href。如何实现?