mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +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> {
|
||||
let startIndex = this.indexOf(view);
|
||||
if (startIndex < 0) {
|
||||
return Promise.reject('View not found to pop to');
|
||||
}
|
||||
|
||||
let activeView = this.getByState(STATE_TRANS_ENTER) ||
|
||||
this.getByState(STATE_INIT_ENTER) ||
|
||||
this.getActive();
|
||||
|
Reference in New Issue
Block a user