【发布时间】:2021-06-08 15:22:47
【问题描述】:
我在应用组件 html 中有这个:
<h1 class="title">{{ title | uppercase }}</h1>
<app-discography-container></app-discography-container>
<app-total-albums></app-total-albums>
<app-single-album></app-single-album>
<router-outlet></router-outlet>
然后我有另一个名为 video 的组件,其路由在 app-module 中声明:
const routes: Routes = [{ path: 'video', component: VideoComponent }];
在app-discography 组件中我有这个:
<a routerLink="/video" target="_blank">
lorem ipsum
</a>
当我点击链接“lorem ipsum”时,我会重定向到视频路径,但我也有组件app-total-albums 和app-single-album,但我不想要它们......我想要它将我重定向到一个单独的页面
【问题讨论】:
-
你的角度版本是什么?在订阅中,我采用当前的路线路径。
标签: angular redirect routes angular-ui-router