ionic-team / ionic-team/ionic-framework

'onSameUrlNavigation' config doesn't work in v4.

Offen
#17,867 3 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
package: angular type: bug
Vorherrschende Sprache
TypeScript
Sterne
52.7k
Forks
13.3k
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
51

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.