How to pick the rootpage?

i’m try to pick the actual rootpage(component). How do I do this?

THANKS TO REPLY COMMUNITY!!
if any need help: its solved…

let view = this.nav.getActive();
let currentRootPage = view.component.name;
currentRootPage return “HomePage” example…

IMHO the above code is a land mine, because it will break in production due to minification. I would recommend avoiding any sort of logic that attempts to find out “what page am I on?”. It’s putting logic in the wrong place and is brittle.

For goals like “I only want X menu item enabled when page Y or Z are active”, enable and disable the menu item from page Y and Z’s lifecycle events.

1 Like