ionic侧滑菜单

1.导入两个包

<link rel="stylesheet" href="lib/css/ionic.min.css" />
<script src="lib/js/ionic.bundle.min.js"></script>


2.创建作用域和控制器

<script>
angular.module("myApp",['ionic'])
.controller("demoa",function($scope,$ionicSideMenuDelegate){
$scope.left=["item0","item1","item2","item3","item4","item5","item6",
"item7","item8","item9","item10","item11","item12","item13"];
$scope.dian=function(){
$ionicSideMenuDelegate.toggleLeft();
};
});
</script>


主体内容3.

<body ng-app="myApp" ng-controller="demoa">
整体
<ion-side-menus>


  <ion-side-menu-content >
  <ion-header-bar align-title="center" class="bar-calm">
  <button class="button icon ion-navicon" ng-click="dian()"></button>
  <h1 class="title" style="font-size: 20px;">Sild me</h1> 
  </ion-header-bar>
  <ion-content>
  <h1 class="title" >Content</h1>
 </ion-content>
  </ion-side-menu-content>
 
 
 <ion-side-menu side="left">
  <ion-header-bar align-title="center" class="bar-positive">
 
  <h1 class="title" style="font-size: 20px;">Left</h1> 
  </ion-header-bar>
  <ion-content>
  <ion-list>
  <ion-item ng-repeat="zuo in left">
  {{zuo}}
  </ion-item>
  </ion-list>
  </ion-content>
  </ion-side-menu>
 
</ion-side-menus>
</body>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值