Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
How can I get the current page name in Onsen 2.0.0 rc.9 ?
-
Hi,
I was using this method in Onsen 1.x before migration to Onsen 2.0.0 rc.9:
myNav.getCurrentPage().page;
But the function getCurrentPage().page is not working after migration to Onsen 2.
-
@Luis-Guilherme-Pires-Moura I think you’re looking for
myNav.topPage.name
. Properties are here.
-
if you want it to appear on your toolbar…this should probably work out for you
<ons-toolbar> <div class="left"> <ons-toolbar-button ng-click="app.slidingMenu.toggleMenu()"><ons-icon icon="bars" style="color:#fff;" ></ons-icon></ons-toolbar-button> </div> <div class="center" style="font-size:25px; color:#fff;"> Name</div> <div class="right"> <ons-toolbar-button>Logout</ons-toolbar-button> </div> </ons-toolbar>