ionic-team / ionic-team/ionic-framework
'onSameUrlNavigation' config doesn't work in v4.
- Ngôn ngữ chính
- TypeScript
- Star
- 52.7k
- Fork
- 13.3k
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 51
Mô tả
Current Ionic Info
Ionic:
ionic (Ionic CLI) : 4.10.3 (/Users/myUser/.nvm/versions/node/v10.15.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.1.2
@angular-devkit/build-angular : 0.13.6
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.6
@ionic/angular-toolkit : 1.4.1
System:
NodeJS : v10.15.0 (/Users/myUser/.nvm/versions/node/v10.15.0/bin/node)
npm : 6.4.1
OS : macOS Mojave
**Current behavior:**
I'm trying to fetch new data based on a global resolved value when a specific page reloads. My resolver fires fine but the activatedRoute.data doesn't receive new data from resolver.
**Expected behavior:**
Ideally, the data should flow back to activatedRoute.data and I should get the new resolved data when the page reloads. It works fine in a pure Angular project.
**Steps to reproduce:**
1. Create new Lazy Loaded Ionic Project with Tabs template.
2. Head over to tab1 and add a new button which on click performs:
`this.router.navigate([], {relativeTo: this.activatedRoute});`
3. Set up a subscription in the page to the latest data from the activatedRoute.data stream.
`this.activatedRoute.data.subscribe(val => {console.log(val)});`
**Related code:**
Set `onSameUrlNavigation: 'reload'` config in `RouterModule.forRoot()` method.
Add a resolver to Tab1 which resolves with an array with a random value.
```
resolve() {
return of([Math.random()]);
}
```
In Tab1Module route variable, add
`resolve {data: Tab1Resolver}, runGuardsAndResolvers: 'always'`
Here's a minimal Ionic Tabs starter template with the essential code where this issue can be observed.
[github](https://github.com/anjildhamala/ionic-starter-template)
Here's a [Stackblitz](https://stackblitz.com/edit/angular6-lazy-loading-l7rd9v) working reproduction of a pure Angular application. **Product Details Page**
Please let me know if I can provide more information to get this issue sorted.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.