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.
Tabbar event load problem
-
Hi All,
First of all library versions that i used is, ONSEN UI release is:1.3.8, Angular JS release is v1.4.3In my app, i want to navigate from main page to a tabbar included onsen page, and what i am failing to do is adding tabbar events.
I cannot add this evet in ons.ready as the tabbar is not part of the main page it is not defined yet.
but when i try to add event via a controller i got tabbar is not defined error, here is the below codepen case;
http://codepen.io/neverhesitate/pen/EZwWRaCan you please help?Thanks,
Best regards.
-
@ferit-unlu Use the init event. Basically, add an event listener for the init event and use the tabbar id in an if statement to check for it.
-
@munsterlander , Thanks for your reply. I have tried and it worked.In the controller, it should be like;
$(document).on(‘pageinit’, ‘#pageid’, function() {
tabbar.on(‘prechange’, function(event) {
//Business logic
});
Best Regards,