ttmind

Main Navigation

ttmind
  • jim-jams
  • Tech
  • Positive
Login

Login

Facebook Google

OR

Remember me Forgot password?

Don't have account? Signup here.

Sort by Categorys

.Net

PHP

Java

JavaScript

Database

Server

Client Side

Tools

Artificial Intelligence

Cloud

Hybrid Development

Event

Smart City

Education

Security

Scrum

Digital Marketing

APP Development

Business

Internet

Simulation

Art

Network

Microservices

Architecture

Technology

Leadership

    Top Articles

  • How Does Social Media Bring People Together?
    TTMind Author
  • How to read appSettings JSON from Class Library in ASP.NET Core
    Anil Shrestha
  • Printing Support In Asp.Net Core
    TTMind Author
  • HOW TO EXTRACT TEXT FROM IMAGE USING JAVASCRIPT (OCR with Tesseract.js)?
    Prakash Pokhrel
  • Images Upload REST API using ASP.NET Core
    Prakash Pokhrel
  • Related Topic

  • Firebase Cloud Messaging (FCM) using Cordova FCM Plugin
  • Cordova Upload Images using File Transfer Plugin and .Net core WebAPI
  • How to get Current user Location from device in ionic Cordova?
  • Could not find gradle wrapper within Android SDK. Might need to update your Android SDK. Looked here: Local\Android\Sdk\tools\templates\gradle\wrapper
  • What is ionic? How to start mobile app development with ionic?
  • Tech
  • About Us
  • Contact Us
  • TechHelp
  • PositiveHelp
  • Jim-Jams Help
  • Terms & Conditions

© Copyright ttmind.com

Main Content

How to make the two side-menu in ionic?

Hybrid Development Ionic about 7 years ago || 10/28/2018 || 4.0 K View

  • Hide

We assume that we have installed everything that we need. Or if you haven’t pleased look on this previous article for how to start mobile app development with ionic? Let’s start the Two-side-menu ionic project.

Open the terminal or node.js command type this command to create the new project on ionic.

ionic start Two -side-menu sidemenu

cd Two -side-menu

ionic serve

will open the default browser and display this page.

ttmind

Now open the app.html and replace the code as below.

<ion-menu [content]="content" side="left">
  <ion-header>
    <ion-toolbar>
      <ion-title>Menu</ion-title>
    </ion-toolbar>
  </ion-header>
  <ion-content>
    <ion-list>
      <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
        {{p.title}}
      </button>
    </ion-list>
  </ion-content>

</ion-menu>
<ion-menu [content]="content" side="right">
  <ion-header>
    <ion-toolbar>
      <ion-title>Notification</ion-title>
    </ion-toolbar>
  </ion-header>

  <ion-content>
    <ion-list>
      <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
        {{p.title}}
      </button>
    </ion-list>
  </ion-content>

</ion-menu>

<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>

Now Open the home.html and replace the code as below.

<ion-header>
  <ion-navbar>
    <button ion-button menuToggle="left">
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title ion-center>ttmind Quiz</ion-title>
    <button ion-button menuToggle="right" right>
        <ion-icon name="notifications"></ion-icon>
      </button>
  </ion-navbar>
</ion-header>

Save the two files and see on the browser.

Click on Notification Icon to see the right side-menu.

ttmind

If you have any Question. please comment below.

 

 

  • 1
  • 0
  • 0
    • Facebook
    • Twitter
    • Google +
    • LinkedIn

About author

Anil Shrestha

Anil Shrestha

Qualified and skilled professional with experience working as a Software Developer

Reset Your Password
Enter your email address that you used to register. We'll send you an email with your username and a link to reset your password.

Quick Survey