How to access the navigation stack NativeScript

Issue

I’m trying to create a breadcrumbs for my Nativescript-Angular application. I read in the navigation documentation that With <page-router-outlet> when you navigate forward, the current page and views are saved in the native navigation stack.

How can i access this navigation stack? This way i can navigate back to a certain page the user wants to go to and clean up all the pages forward of that component.

Thanks

Solution

You can always query through the Frame and BackStack, even use them to close multiple pages at one go in case of NativeScript Core.

For NativeScript Angular, there is a open feature request, but you could still use Frame / NSLocationStrategy to find all pages in history.

Answered By – Manoj

Answer Checked By – Candace Johnson (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.