ionic-team / ionic-team/ionic-framework

router outlet pop promise executed after then

Ouverte
#17,697 9 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
package: angular type: bug
Langage dominant
TypeScript
Étoiles
52.7k
Forks
13.3k
Merge moyen
1 j 15 h
PR mergées (30 j)
51

Description

# 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
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.