chore(angular): update dependencies

fixes #16539
This commit is contained in:
Manu Mtz.-Almeida
2018-12-10 21:00:01 +01:00
committed by Manu MA
parent a9247ce0e9
commit 509cfd54aa
4 changed files with 45 additions and 34 deletions

View File

@ -44,24 +44,35 @@
"css/"
],
"dependencies": {
"@ionic/core": "4.0.0-beta.17"
"@ionic/core": "4.0.0-beta.17",
"tslib": "^1.9.3"
},
"peerDependencies": {
"@angular-devkit/core": "^7.0.3",
"@angular-devkit/schematics": "^7.0.3"
"@angular-devkit/core": "^7.1.2",
"@angular-devkit/schematics": "^7.1.2",
"@angular/core": "^7.1.2",
"@angular/common": "^7.1.2",
"@angular/forms": "^7.1.2",
"@angular/router": "~7.1.2",
"@angular/compiler": "^7.1.2",
"@angular/compiler-cli": "^7.1.2",
"@angular/platform-browser": "^7.1.2",
"@angular/platform-browser-dynamic": "^7.1.2",
"rxjs": ">=6.2.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/core": "^7.0.3",
"@angular-devkit/schematics": "^7.0.3",
"@angular-devkit/core": "^7.1.2",
"@angular-devkit/schematics": "^7.1.2",
"@angular/core": "^7.1.2",
"@angular/common": "^7.1.2",
"@angular/forms": "^7.1.2",
"@angular/router": "^7.1.2",
"@angular/compiler": "^7.1.2",
"@angular/compiler-cli": "^7.1.2",
"@angular/platform-browser": "^7.1.2",
"@angular/platform-browser-dynamic": "^7.1.2",
"@types/node": "~10.12.0",
"@angular/common": "^7.0.3",
"@angular/compiler": "^7.0.3",
"@angular/compiler-cli": "^7.0.3",
"@angular/core": "^7.0.3",
"@angular/forms": "^7.0.3",
"@angular/platform-browser": "^7.0.3",
"@angular/platform-browser-dynamic": "^7.0.3",
"@angular/router": "^7.0.3",
"fs-extra": "^7.0.0",
"glob": "^7.1.2",
"rxjs": "^6.2.0",

View File

@ -1,5 +1,4 @@
import { Directive, ElementRef, HostListener, Input, Optional } from '@angular/core';
import { Router } from '@angular/router';
import { NavController } from '../../providers/nav-controller';
import { IonRouterOutlet } from './ion-router-outlet';
@ -17,7 +16,6 @@ export class IonBackButtonDelegate {
}
constructor(
@Optional() private router: Router,
@Optional() private routerOutlet: IonRouterOutlet,
private navCtrl: NavController,
private elementRef: ElementRef,
@ -28,7 +26,7 @@ export class IonBackButtonDelegate {
if (this.routerOutlet && this.routerOutlet.canGoBack()) {
this.routerOutlet.pop();
ev.preventDefault();
} else if (this.router && this.defaultHref != null) {
} else if (this.defaultHref != null) {
this.navCtrl.navigateBack(this.defaultHref);
ev.preventDefault();
}

View File

@ -15,10 +15,10 @@ export class RouterLinkDelegate {
@Input() routerDirection: NavDirection = 'forward';
constructor(
private router: Router,
private locationStrategy: LocationStrategy,
private navCtrl: NavController,
private elementRef: ElementRef,
private router: Router,
@Optional() private routerLink?: RouterLink,
) { }

View File

@ -1,4 +1,4 @@
import { Injectable } from '@angular/core';
import { Injectable, Optional } from '@angular/core';
import { Location } from '@angular/common';
import { NavigationExtras, NavigationStart, Router, UrlTree } from '@angular/router';
import { Platform } from './platform';
@ -16,19 +16,21 @@ export class NavController {
private lastNavId = -1;
constructor(
platform: Platform,
private location: Location,
private router: Router,
platform: Platform
@Optional() private router?: Router,
) {
// Subscribe to router events to detect direction
router.events.subscribe(ev => {
if (ev instanceof NavigationStart) {
const id = (ev.restoredState) ? ev.restoredState.navigationId : ev.id;
this.guessAnimation = !ev.restoredState;
this.guessDirection = id < this.lastNavId ? 'back' : 'forward';
this.lastNavId = this.guessDirection === 'forward' ? ev.id : id;
}
});
if (router) {
router.events.subscribe(ev => {
if (ev instanceof NavigationStart) {
const id = (ev.restoredState) ? ev.restoredState.navigationId : ev.id;
this.guessAnimation = !ev.restoredState;
this.guessDirection = id < this.lastNavId ? 'back' : 'forward';
this.lastNavId = this.guessDirection === 'forward' ? ev.id : id;
}
});
}
// Subscribe to backButton events
platform.backButton.subscribeWithPriority(0, () => this.goBack());
@ -37,9 +39,9 @@ export class NavController {
navigateForward(url: string | UrlTree | any[], animated?: boolean, extras?: NavigationExtras) {
this.setDirection('forward', animated);
if (Array.isArray(url)) {
return this.router.navigate(url, extras);
return this.router!.navigate(url, extras);
} else {
return this.router.navigateByUrl(url, extras);
return this.router!.navigateByUrl(url, extras);
}
}
@ -47,18 +49,18 @@ export class NavController {
this.setDirection('back', animated);
// extras = { replaceUrl: true, ...extras };
if (Array.isArray(url)) {
return this.router.navigate(url, extras);
return this.router!.navigate(url, extras);
} else {
return this.router.navigateByUrl(url, extras);
return this.router!.navigateByUrl(url, extras);
}
}
navigateRoot(url: string | UrlTree | any[], animated?: boolean, extras?: NavigationExtras) {
this.setDirection('root', animated);
if (Array.isArray(url)) {
return this.router.navigate(url, extras);
return this.router!.navigate(url, extras);
} else {
return this.router.navigateByUrl(url, extras);
return this.router!.navigateByUrl(url, extras);
}
}