我這樣一個簡單的事情掙扎按鈕。我有一個離子菜單。我想讓帖子頁面成爲主頁的子視圖。但是當我從主頁導航到帖子頁面時,後退按鈕丟失。另外我不確定如何定義navbar(index.html,menu.html或post.html)。離子側菜單:沒有回
路由器:
$stateProvider
.state('menu', {
url: '/menu',
abstract: true,
templateUrl: 'templates/menu.html'
})
.state('menu.home', {
url: '/home',
views: {
'menuContent': {
templateUrl: 'templates/home.html',
controller: 'HomeCtrl',
resolve: {authResolve: authResolve}
}
}
})
.state("post", {
url: "/home/:uid/:postId",
templateUrl: "templates/timeline/post.html",
controller: "PostCtrl as post",
resolve: {authResolve: authResolve}
})
的index.html:
<body ng-app="starter" animation="slide-left-right-ios7">
<div>
<div>
<ion-nav-bar>
<ion-nav-back-button side="left" class="button-icon ion-arrow-left-c"></ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
</div>
</div>
menu.html:
<ion-side-menus enable-menu-with-back-views="true">
<ion-side-menu-content>
<ion-nav-bar class="bar-positive">
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left"></button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-side-menu-content>
post.html:
<ion-view>
<ion-nav-bar>
<ion-nav-back-button side="left" class="button-icon ion-arrow-left-c"></ion-nav-back-button>
</ion-nav-bar>
當我這樣做的問題是,而不是後退按鈕,我得到它打開側邊菜單的導航圖標。 – dms