mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
feat(angular): push/setRoot/pop
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { Directive, HostListener } from '@angular/core';
|
||||
import { NavController } from '../../providers/nav-controller';
|
||||
import { NavController, NavIntent } from '../../providers/nav-controller';
|
||||
|
||||
@Directive({
|
||||
selector: '[goBack]',
|
||||
@ -12,6 +12,6 @@ export class GoBack {
|
||||
|
||||
@HostListener('click')
|
||||
onClick() {
|
||||
this.navCtrl.setGoback();
|
||||
this.navCtrl.setIntent(NavIntent.Back);
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user