Ionic js 17: Sidebar Menu

Source: Internet
Author: User

A container element contains side menus and main content. Toggle the sidebar menu on the left or right by dragging the main content area from one side to the other.
As shown below:

?

?

Usage
To use the sidebar menu, add a parent element, an intermediate content, and one or more instructions.

<Ion-side-menus>  <!--Intermediate Content -  <ion-side-menu-contentNg-controller= "Contentcontroller">  </ion-side-menu-content>  <!--left menu -  <Ion-side-menuside= "Left">  </Ion-side-menu>  <!--menu on the right -  <Ion-side-menuside= "Right">  </Ion-side-menu></Ion-side-menus>

function Contentcontroller ($scope, $ionicSideMenuDelegate) {  function() {    $ Ionicsidemenudelegate.toggleleft ();  };}

?

?

?

Ion-side-menu-content
A container of visible principal content, one or more ionsidemenu directives of a sibling.
Usage

< ion-side-menu-content   drag-content = "true" > </ ion-side-menu-content >

?

Ion-side-menu
A container for a sidebar menu, a ion-side-menu-content instruction of a sibling.
Usage

< Ion-side-menu   side = "Left"   width= "Mywidthvalue +"  is-enabled= "shouldleftsidemenubeenabled ()"  ></ion-side-menu>

?

Menu-toggle
Toggles the menu in a specified sidebar.
Usage
Here is an example of a link within the navigation bar. Clicking this link will automatically open the specified sidebar menu.

<Ion-view>  <ion-nav-buttonsside= "Left">   <ButtonMenu-toggle= "Left"class= "button Button-icon icon Ion-navicon"></Button>  </ion-nav-buttons> ...</Ion-view>

Menu-close
Close the currently open sidebar menu.
Usage
Here is an example of a link within the navigation bar. Clicking this link will automatically open the specified sidebar menu.

<menu-close href= "#/home"  class= "item"> Home Page </ a >

$ionicSideMenuDelegate
This method directly triggers \ (ionicsidemenudelegate service, to control all sidebar menus. Use the \) Getbyhandle method to control Ionsidemenus in a particular case.
Usage

<BodyNg-controller= "Mainctrl">  <Ion-side-menus>    <ion-side-menu-content>content! <ButtonNg-click= "Toggleleftsidemenu ()">Toggle left Sidebar menu</Button>    </ion-side-menu-content>    <Ion-side-menuside= "Left">left Menu! <Ion-side-menu>  </Ion-side-menus></Body>

function Mainctrl ($scope, $ionicSideMenuDelegate) {  function() {    $ Ionicsidemenudelegate.toggleleft ();  };}

Method

Toggleleft ([IsOpen])

?
?

Ionic js 17: Sidebar Menu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.