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.3

    In 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;

    Can 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,

Log in to reply