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>