mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
86 lines
2.6 KiB
HTML
86 lines
2.6 KiB
HTML
<html ng-app="sideMenuTest">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Side Menus</title>
|
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
|
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
|
|
<script src="../../../../dist/js/ionic.bundle.js"></script>
|
|
</head>
|
|
<body>
|
|
|
|
<div ng-controller="MenuCtrl">
|
|
|
|
<ion-side-menus>
|
|
|
|
<ion-side-menu-content>
|
|
<header class="bar bar-header bar-positive">
|
|
<button class="button button-icon ion-navicon" ng-click="toggleLeft()"></button>
|
|
<h1 class="title">Slide me</h1>
|
|
<button class="button button-icon ion-navicon" ng-click="toggleRight()"></button>
|
|
</header>
|
|
<ion-content class="has-header">
|
|
<ion-toggle ng-model="$root.$draggy">Hello</ion-toggle>
|
|
<input type="range" ng-model="$root.menuWidth" min="0" max="300">
|
|
<h1>Content</h1>
|
|
<ion-list option-buttons="[{text:'Hello',type:'button-positive'}]">
|
|
<ion-item>Sup</ion-item>
|
|
</ion-list>
|
|
</ion-content>
|
|
</ion-side-menu-content>
|
|
|
|
<ion-side-menu side="left" width="$root.menuWidth || 270" ng-controller="LeftCtrl">
|
|
<header class="bar bar-header bar-assertive">
|
|
<h1 class="title">Left</h1>
|
|
</header>
|
|
<ion-content class="has-header">
|
|
<h3>value = {{value}}</h3>
|
|
<ul class="list">
|
|
<a href="#" class="item" ng-repeat="item in list">
|
|
{{item.text}}
|
|
</a>
|
|
</ul>
|
|
</ion-content>
|
|
</ion-side-menu>
|
|
|
|
<ion-side-menu side="right">
|
|
<header class="bar bar-header bar-royal">
|
|
<h1 class="title">Right</h1>
|
|
</header>
|
|
<ion-content>
|
|
<ul class="list">
|
|
<a href="#" class="item" ng-repeat="item in list">
|
|
{{item.text}}
|
|
</a>
|
|
</ul>
|
|
</ion-content>
|
|
</ion-side-menu>
|
|
|
|
</ion-side-menus>
|
|
|
|
</div>
|
|
<script>
|
|
angular.module('sideMenuTest', ['ionic'])
|
|
|
|
.controller('MenuCtrl', function($scope, $ionicSideMenuDelegate) {
|
|
|
|
$scope.toggleLeft = $ionicSideMenuDelegate.toggleLeft;
|
|
$scope.toggleRight = $ionicSideMenuDelegate.toggleRight;
|
|
|
|
$scope.list = [];
|
|
for(var i = 0; i < 20; i++) {
|
|
$scope.list.push({
|
|
text: 'Item ' + i
|
|
});
|
|
}
|
|
})
|
|
|
|
.controller('LeftCtrl', function($scope) {
|
|
$scope.value = true;
|
|
$scope.list = [{text:1},{text:2},{text:3}];
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|