ionic-team / ionic-team/ionic-framework

router outlet pop promise executed after then

Aperta
#17,697 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub
package: angular type: bug
Lingua principale
TypeScript
Stelle
52.7k
Fork
13.3k
Merge medio
1g 15h
PR unite (30g)
51

Descrizione

# Bug Report

**Ionic version:**
[x] **4.x**

**Current behavior:**
When I call pop() promise on a ion router outlet, and I attach a callback to it, the callback is executed before end of pop.

**Expected behavior:**
The callback should be executed after pop

**Steps to reproduce:**
Ionic 4 project,

**Related code:**
app.component.ts
```
@ViewChild('masterNav', { read: IonRouterOutlet })masterNav: IonRouterOutlet;
@ViewChild('detailNav', { read: IonRouterOutlet })detailNav: IonRouterOutlet;
...
myFunction(): void{
this.masterNav.pop().then(() => {
//this hasn't finish to pop, so it goes to the below route... and then pops it
this.navCtrl.navigateRoot(["", { outlets: { detailNav: "path/to/thing"}}]);
});
}
```

app.component.html
```



```

**Ionic info:**
```
Ionic:

ionic (Ionic CLI) : 4.10.3 (C:\Users\myuser\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.0.1
@angular-devkit/build-angular : 0.12.3
@angular-devkit/schematics : 7.2.3
@angular/cli : 7.2.3
@ionic/angular-toolkit : 1.2.3

Cordova:

cordova (Cordova CLI) : not installed
Cordova Platforms : not available
Cordova Plugins : not available

System:

Android SDK Tools : 26.1.1 (C:\Users\myuser\AppData\Local\Android\sdk)
NodeJS : v10.15.0 (C:\Program Files\nodejs\node.exe)
npm : 6.7.0
OS : Windows 10
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.