HTML:
<ion-side-menus>
<ion-side-menu side="left" expose-aside-when="(min-width:0px)">
侧面菜单栏
{{{true:'',false:'contentDisabled'}[currPage]}}
</ion-side-menu>
<ion-side-menu-content ng-class="{true:'contentDisabled',false:''}[currPage]">
<ion-nav-bar align-title="center">
<ion-nav-back-button class="button-positive">
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
</ion-side-menu-content>
</ion-side-menus>
css:
/*侧面菜单隐藏*/
ion-side-menu-content.contentDisabled {
width: auto !important;
transform: initial !important;
-ms-transform:initial !important; /* IE 9 */
-moz-transform:initial !important; /* Firefox */
-webkit-transform:initial !important; /* Safari 和 Chrome */
-o-transform:initial !important; /* Opera */
}
js:
//监听页面变化
$scope.currState = $state;
$scope.$watch('currState.current.name', function(newValue, oldValue) {
console.log("page:"+newValue);
if(newValue=='login'||newValue=='master'||newValue == 'addMaster'||newValue==''){
$rootScope.currPage = true;
}else{
$rootScope.currPage = false;
}
});
网友评论