fix(router): transition race condition

fixes #14873
fixes #15090
This commit is contained in:
Manu Mtz.-Almeida
2018-08-09 02:40:27 +02:00
parent 01690452e9
commit 50ad1e7c5a
9 changed files with 143 additions and 59 deletions

View File

@@ -162,11 +162,11 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
}
function emitEvent(el: HTMLElement) {
const event = new CustomEvent('ionRouterOutletActivated', {
const ev = new CustomEvent('ionRouterOutletActivated', {
bubbles: true,
cancelable: true,
});
el.dispatchEvent(event);
el.dispatchEvent(ev);
}
class OutletInjector implements Injector {

View File

@@ -39,7 +39,6 @@ export class StackController {
const leavingView = this.getActive();
this.insertView(enteringView, direction);
await this.transition(enteringView, leavingView, direction, animated, this.canGoBack(1));
this.cleanup();
}

View File

@@ -1,4 +1,5 @@
import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core';
import { IonicConfig } from '@ionic/core';
import { CommonModule } from '@angular/common';
import { appInitialize } from './app-initialize';
@@ -133,7 +134,7 @@ const PROVIDERS = [
imports: [CommonModule]
})
export class IonicModule {
static forRoot(config?: { [key: string]: any }): ModuleWithProviders {
static forRoot(config?: IonicConfig): ModuleWithProviders {
return {
ngModule: IonicModule,
providers: [

View File

@@ -1,11 +1,11 @@
import { Config as CoreConfig } from '@ionic/core';
import { Config as CoreConfig, IonicConfig } from '@ionic/core';
import { InjectionToken } from '@angular/core';
import { IonicWindow } from '../types/interfaces';
export class Config {
get(key: string, fallback?: any): any {
get(key: keyof IonicConfig, fallback?: any): any {
const c = getConfig();
if (c) {
return c.get(key, fallback);
@@ -13,7 +13,7 @@ export class Config {
return null;
}
getBoolean(key: string, fallback?: boolean): boolean {
getBoolean(key: keyof IonicConfig, fallback?: boolean): boolean {
const c = getConfig();
if (c) {
return c.getBoolean(key, fallback);
@@ -21,7 +21,7 @@ export class Config {
return false;
}
getNumber(key: string, fallback?: number): number {
getNumber(key: keyof IonicConfig, fallback?: number): number {
const c = getConfig();
if (c) {
return c.getNumber(key, fallback);
@@ -29,7 +29,7 @@ export class Config {
return 0;
}
set(key: string, value?: any) {
set(key: keyof IonicConfig, value?: any) {
const c = getConfig();
if (c) {
c.set(key, value);