Skip to content

Commit

Permalink
chore(nav): add promise rejects to popTo
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Jun 2, 2016
1 parent fc29124 commit 9cd80cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/nav/nav-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9cd80cb

Please sign in to comment.