Error: NavigatorView's page stack is empty in

2019-08-09 17:17发布

问题:

I'm developing mobile application using onsenUI and facing this problem when navigating to pages in stack.

When moving from first page to second page, we normally use pushPage(). From second page to first page, we use popPage(). But when moving from third page to second page using back button and from second page to first page, I'm getting

Error: NavigatorView's page stack is empty

I tried using resetToPage() but still getting this error..

Here what I tried.

PLUNKER

UPDATED:

When navigating from services.html to index.html, I'm getting this error in console. Please check this. When I poppage from third page to second page, then second page to first page, I'm getting error as navigation view page stack is empty

回答1:

<ons-back-button> already perform a popPage itself, so there is no need to do ng-click="myNavigator.popPage() in it. With that it will try to delete 2 pages from the stack when there is only 1, so it warns that the page stack is empty when trying to perform the second popPage. Hope it helps!