feat(angular): add global pop() (#17182)

fixes #16340
This commit is contained in:
Manu MA
2019-01-21 01:52:47 +01:00
committed by GitHub
parent 25b88478a1
commit 766c79d2a1
7 changed files with 35 additions and 11 deletions

View File

@ -3620,7 +3620,7 @@ export namespace Components {
/**
* Go back to previous page in the window.history.
*/
'goBack': () => Promise<void>;
'back': () => Promise<void>;
'navChanged': (direction: RouterDirection) => Promise<boolean>;
'printDebug': () => void;
/**

View File

@ -69,7 +69,7 @@ If you're using Angular, please see [ion-router-outlet](../router-outlet) instea
## Methods
### `goBack() => Promise<void>`
### `back() => Promise<void>`
Go back to previous page in the window.history.

View File

@ -83,7 +83,7 @@ export class Router implements ComponentInterface {
@Listen('document:ionBackButton')
protected onBackButton(ev: BackButtonEvent) {
ev.detail.register(0, () => this.goBack());
ev.detail.register(0, () => this.back());
}
/**
@ -105,7 +105,7 @@ export class Router implements ComponentInterface {
* Go back to previous page in the window.history.
*/
@Method()
goBack() {
back() {
this.win.history.back();
return Promise.resolve(this.waitPromise);
}