ionic-team / ionic-team/ionic-framework

bug: routing with angular [queryParams] breaks subsequent relative navigations

未关闭
#24,587 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
package: angular type: bug
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 15 小时
30 天内合并 PR
51

描述

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

- [ ] v4.x
- [X] v5.x
- [X] v6.x

### Current Behavior

With Angular, when using `ion-router-outlet` as navigation root, relative navigation breaks if we use [routerLink] with a relative route combined with any [queryParams] value. After the first one, all other relative routes would not trigger navigation anymore.

### Expected Behavior

The `ion-router-outlet` should behave like the angular's `router-router` : relative navigation is still possible once we navigated with query params.

### Steps to Reproduce

I made a simple repro : https://stackblitz.com/edit/ionic-angular-v5-xjfgnp?file=src/app/dummy.component.ts
You can switch from Ionic to Angular router outlet using the top toggle button.

Once you click on the second link `Stay on route 1 with query params` with ion-router-outlet, relative navigation to other routes is broken and 3rd link will not trigger navigation anymore.

The same actions with Angular `router-outlet` would still work.

### Code Reproduction URL

https://github.com/adeprez/ionic-angular-v6-relative-nav-issue

### Ionic Info

_No response_

### Additional Information

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。