Navigation

    Monaca & Onsen UI
    • Register
    • Login
    • Search
    • Tags
    • Users
    • Blog
    • Playground
    1. Home
    2. jjyepez
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    jjyepez

    @jjyepez

    0
    Reputation
    2
    Posts
    1162
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    jjyepez Follow

    Posts made by jjyepez

    • RE: ons.ready() is loading before ready

      Hi, there.
      I’m trying to do some thigs on <ons-navigator> “postchange” event via AngularJS -> var_name.on( … ) method, and I’m not getting the right behavior when inlcuded in ons.ready

      html

      <ons-page ng-controller="myCtrlr">
         <ons-navigator var="nav_app">
            <!--  content  -->
         </ons-navogator>
      </ons-page>
      

      js

      var app = ons.bootstrap();
      app
      .controller('myCtlr', function( $scope ){
         ons.ready(
            nav_app.on('postchange', function(){
                // --- something cool
            })
         )
      })
      

      My fallback so far, has been using $timeout … like this

      var app = ons.bootstrap();
      app
      .controller('myCtlr', function( $scope, $timeout ){
         $timeout( function(){
            nav_app.on('postchange', function(){
                // --- something cool
            })
         }, 100)
      })
      

      So, I dont know if I’m doing something wrong but I wish I can use ons.ready so it’s done the proper way.

      Any help would be very appreciated.
      Cheers.

      jjyepez

      posted in Onsen UI
      jjyepez