feat(angular): push/setRoot/pop

This commit is contained in:
Manu Mtz.-Almeida
2018-04-10 23:51:36 +02:00
parent 81dc67dda4
commit 4d23cba8a0
3 changed files with 44 additions and 12 deletions

View File

@ -1,6 +1,6 @@
import { Directive, ElementRef, HostListener, Input, Optional } from '@angular/core';
import { Router } from '@angular/router';
import { NavController } from '../../providers/nav-controller';
import { NavController, NavIntent } from '../../providers/nav-controller';
import { IonRouterOutlet } from './ion-router-outlet';
@Directive({
@ -29,7 +29,7 @@ export class IonBackButton {
this.routerOutlet.pop();
ev.preventDefault();
} else if (this.router && this.defaultHref != null) {
this.navCtrl.setGoback();
this.navCtrl.setIntent(NavIntent.Back);
this.router.navigateByUrl(this.defaultHref);
ev.preventDefault();
}