IonicModule /** * @ngdoc directive * @name ionSideMenus * @module ionic * @delegate ionic.service:$ionicSideMenuDelegate * @restrict E * * @description * A container element for side menu(s) and the main content. Allows the left * and/or right side menu to be toggled by dragging the main content area side * to side. * * ![Side Menu](http://ionicframework.com.s3.amazonaws.com/docs/controllers/sidemenu.gif) * * For more information on side menus, check out the documenation for * {@link ionic.directive:ionSideMenuContent} and * {@link ionic.directive:ionSideMenu}. * * @usage * To use side menus, add an `` parent element, * an `` for the center content, * and one or more `` directives. * * ```html * * * * * * * * * * * * * * ``` * ```js * function ContentController($scope, $ionicSideMenuDelegate) { * $scope.toggleLeft = function() { * $ionicSideMenuDelegate.toggleLeft(); * }; * } * ``` * * @param {string=} delegate-handle The handle used to identify this side menu * with {@link ionic.service:$ionicSideMenuDelegate}. * */ /** * @ngdoc demo * @name ionSideMenus#simple * @module sideMenusSimple * @javascript var app = angular.module('sideMenusSimple', ['ionic']); app.controller('SideMenusSimpleCtrl', function($scope, $ionicSideMenuDelegate) { $scope.toggleLeft = function() { $ionicSideMenuDelegate.toggleLeft(); }; }); * * @html

Slide the content or press the button on the header to open a side menu.

Close Menu
*/ /** * @ngdoc demo * @name ionSideMenus#navWithMenu * @module sideMenuWithNav * @javascript angular.module('sideMenuWithNav', ['ionic']) .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('app', { url: "/app", abstract: true, templateUrl: "templates/menu.html", controller: 'AppCtrl' }) .state('app.search', { url: "/search", views: { 'menuContent' :{ templateUrl: "templates/search.html" } } }) .state('app.browse', { url: "/browse", views: { 'menuContent' :{ templateUrl: "templates/browse.html" } } }) .state('app.playlists', { url: "/playlists", views: { 'menuContent' :{ templateUrl: "templates/playlists.html", controller: 'PlaylistsCtrl' } } }) .state('app.single', { url: "/playlists/:playlistId", views: { 'menuContent' :{ templateUrl: "templates/playlist.html", controller: 'PlaylistCtrl' } } }); // if none of the above states are matched, use this as the fallback $urlRouterProvider.otherwise('/app/playlists'); }) .controller('AppCtrl', function($scope) { }) .controller('PlaylistsCtrl', function($scope) { $scope.playlists = [ { title: 'Reggae', id: 1 }, { title: 'Chill', id: 2 }, { title: 'Dubstep', id: 3 }, { title: 'Indie', id: 4 }, { title: 'Rap', id: 5 }, { title: 'Cowbell', id: 6 } ]; }) .controller('PlaylistCtrl', function($scope, $stateParams) { }) * * @html */ .directive('ionSideMenus', [function() { return { restrict: 'ECA', replace: true, transclude: true, controller: '$ionicSideMenus', template: '
' }; }]);