ons-navigator.pushPage seems broken in beta 10



  • Hi Team,

    We have noticed that ons-navigator.pushPage has stopped working in beta 10 (2635). Neither it brings in another page nor throws console error. In case if this is not deprecated, you may want to have a look. If required I can setup a codepen demo.

    Regards,
    CNaik.


  • Onsen UI

    @CNaik It was working the last time I used in beta.10 :sweat_smile:
    Could you make that Codepen example?



  • Hi Fran,

    Sorry for getting disappeared for about a month. Actually we didn’t move to new version of Onsen at that time and hence I stopped exploring in detail.

    Coming to the point now as we are planning to upgrade Onsen verison.

    The problem was not with pushPage but in getCurrentPage() of ons-navigator.

    In beta9, we used navigator.getCurrentPage().options.title in one of the controller to pass value from one page to another while pushing page into navigator. But latest build (v2 RC.5) throws console error that getCurrentPage() is not a function. I tried looking for alternative without success.

    Could you let me know how to retrieve custom data passed into pushPage options ?

    Regards,
    CNaik.



  • Hi Fran,

    I have found the solution, so no need to spend your time on this.

    Have passed values in options.data object in navigator.pushPage and accessed them in another page using navigator.topPage.data.

    Regards,
    Chintan.


  • Onsen UI

    @CNaik Good to see you around again! Good luck with the app :)


Log in to reply