我有一个移动应用程序,右边只有2页汉堡包图标,我只想在这2页上包含一个辅助菜单,我将如何使用离子附加,我已经采取空白的应用程序作为一个开始的模块,请帮助。
这是我的index.html
<body ng-app="starter">
<ion-nav-bar>
<ion-nav-back-button class="button-clear">
</ion-nav-back-button>
<ion-nav-buttons side="right">
<button class="ion-ios-search-strong button-clear search-icon"></button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
</body>
这是我的app.js状态
$stateProvider
// setup an abstract state for the tabs directive
.state('login', {
url: '/',
templateUrl: 'login/login.html',
controller: 'loginCtrl'
})
.state('home', {
url: "/home",
templateUrl: "home/home.html",
controller:"homeCtrl"
})
这是我要在右侧显示菜单的页面:
<ion-view view-title="ASSET 1">
<ion-nav-buttons side="right">
<button class="ion-ios-search-strong button-clear search-icon"></button>
<button class="ion-navicon button-clear hamburger-icon">
</button>
</ion-nav-buttons>
<ion-view hide-nav-bar="false" class="ane" ng-controller="assetdetailCtrl">
<ion-content>
hii there
</ion-content>
这里是menu.html:
<ion-side-menus enable-menu-with-back-views="false">
<ion-side-menu-content>
<ion-nav-bar class="bar-balanced">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="right">
<button class="button button-icon button-clear ion-navicon" menu-toggle="right">
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-content>
<ion-list>
<ion-item nav-clear menu-close href="#/home/home">
<i class="icon ion-home"></i> Início
</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
</ion-side-menus>