popping ( poppage() ) back to the top in one go



  • I have taken the user through a few pages using pushpage() and then, at the final page, they have the option of saving what they have chosen. Thereby negating the need to go back through the previous pages. Can I ‘jump’ straight back to the homepage?



  • @StevieC Yes, per the documents here: https://onsen.io/v2/docs/js/ons-navigator.html

    You would want to use: resetToPage(page, [options])


  • Onsen UI

    @StevieC As @munsterlander said, you can use resetToPage, but it has a push animation by default. Here I implemented a simple pop animation with a new animator (works from 2.0.5).

    Otherwise, you can remove pages from the stack before popPage. The best way would be doing myNavigator.pageLoader.unload( pageElement ). You can access to the page stack with myNavigator.pages.



  • Excellent. Thanks chaps.


Log in to reply