侧边菜单仅在刷新后出现

Side menu appears only after refresh

我想用 Ionic 框架创建一个移动应用程序(我的第一个)。我创建了 expense.html 和 expense-detail.html。侧边菜单在 expense.html 页面上正确显示,但在 "child" 页面上它仅在刷新后出现。这是我的代码:

这是我的侧边菜单:

<ion-side-menus>
    <ion-side-menu-content>
         <ion-header-bar class="bar-header bar-dark">
             <button class="button button-icon icon ion-navicon" menu-toggle="left"></button>
             <div class="h1 title">My Money Tracker</div>
         </ion-header-bar>
        <ion-nav-view name="mainContent" animation="slide-left-right"></ion-nav-view>
        <ion-content></ion-content> 
    </ion-side-menu-content> 
    <ion-side-menu side="left">
          <a menu-close ui-sref="app.expenses" class="item">Expenses</a>
          <a menu-close ui-sref="app.incomes" class="item">Incomes</a>
          <a menu-close ui-sref="app.categories" class="item">Categories</a>
          <a menu-close ui-sref="app.statistics" class="item">Statistics</a>
          <a menu-close ui-sref="app.account" class="item">Account</a>
    </ion-side-menu>
</ion-side-menus>

这些是应用程序的状态:

    .state('app.expenses', {
        url:"/expenses",
        views: {
            "mainContent" : {
                templateUrl : "app/expenses/expenses.html"
            }
        }
    })

    .state('app.expense-detail', {
        url:"/expenses/:id",
        views: {
            "mainContent" : {
                templateUrl : "app/expenses/expense-detail.html"
            }
        }
    })

默认情况下,侧边菜单出现在所有 app.* 状态中,只有在刷新后才会出现的 app.*-detail 除外。 我做错了什么?

我通过阅读此 http://ionicframework.com/docs/api/directive/menuToggle/ 并将 enable-menu-with-back-views="true" 添加到侧边菜单

解决了这个问题