mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 13:01:01 +08:00
chore(nav): add promise rejects to popTo
This commit is contained in:
@ -745,6 +745,10 @@ export class NavController extends Ion {
|
|||||||
*/
|
*/
|
||||||
popTo(view: ViewController, opts?: NavOptions): Promise<any> {
|
popTo(view: ViewController, opts?: NavOptions): Promise<any> {
|
||||||
let startIndex = this.indexOf(view);
|
let startIndex = this.indexOf(view);
|
||||||
|
if (startIndex < 0) {
|
||||||
|
return Promise.reject('View not found to pop to');
|
||||||
|
}
|
||||||
|
|
||||||
let activeView = this.getByState(STATE_TRANS_ENTER) ||
|
let activeView = this.getByState(STATE_TRANS_ENTER) ||
|
||||||
this.getByState(STATE_INIT_ENTER) ||
|
this.getByState(STATE_INIT_ENTER) ||
|
||||||
this.getActive();
|
this.getActive();
|
||||||
|
Reference in New Issue
Block a user