Ionic framework $state.go('app.home'); is adding back button on page where I want to go (how to remove it)?

前端 未结 6 930
不知归路
不知归路 2021-01-30 12:56

I have app with sidebar menu. I am on second page and I am calling controller function which redirect me to first page using:

$state.go(\'app.home\');
         


        
6条回答
  •  一个人的身影
    2021-01-30 13:35

    I had this problem too when using Ionic's side menu.

    In some cases when selecting an option from the side menu the resulting page/view was showing a back button in the navbar, which it shouldn't (because selecting a menu option should reset the history).

    The problem was related to using "ng-click" in the menu option, e.g:

    with 'showStartPage' being a Controller method which calls $state.go(...).

    Solution was to code it like this:

    When done like this, Ionic is (apparently) able to properly keep track of the navigation history.

    (I didn't try it out but probably "ui-sref" instead of "href" would work too)

提交回复
热议问题