mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
BREAKING CHANGE: All directives are now prefixed with `ion-`.
For any directive you use, add the ionic prefix.
For example, change this HTML:
```html
<tabs>
<tab title="home" href="/tab/home">
<content>Hello!</content>
</tab>
</tabs>
```
To this HTML:
```
<ion-tabs>
<ion-tab title="home" href="/tab/home">
<ion-content>Hello!</ion-content>
</ion-tab>
</ion-tabs>
```
70 lines
2.3 KiB
HTML
70 lines
2.3 KiB
HTML
<html ng-app="sideMenuTest">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Side Menus</title>
|
|
|
|
<!-- Sets initial viewport load and disables zooming -->
|
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
<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-pane ion-side-menu-content drag-content="$root.$draggy">
|
|
<header class="bar bar-header bar-assertive">
|
|
<button class="button button-icon" ng-click="openLeft()"><i class="icon ion-navicon"></i></button>
|
|
<h1 class="title">Slide me</h1>
|
|
</header>
|
|
<ion-content has-header="true">
|
|
<ion-toggle ng-model="$root.$draggy">Hello</ion-toggle>
|
|
<input type="range" ng-model="$root.menuWidth" min="0" max="300">
|
|
<h1>Content</h1>
|
|
</ion-content>
|
|
</ion-pane>
|
|
<ion-side-menu side="left" width="$root.menuWidth || 200">
|
|
<header class="bar bar-header bar-assertive">
|
|
<h1 class="title">Left</h1>
|
|
</header>
|
|
<ion-content has-header="true">
|
|
<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-assertive">
|
|
<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.list = [];
|
|
for(var i = 0; i < 20; i++) {
|
|
$scope.list.push({
|
|
text: 'Item ' + i
|
|
});
|
|
}
|
|
$scope.openLeft = function() {
|
|
$ionicSideMenuDelegate.toggleLeft($scope);
|
|
};
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|