Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 2 - How to remove split panel on login page only?

I use this code in app.html, the split-pane is working beautifully. But the problem is, the pane is working for every page like login or SignUp, so please help me to prevent the split pane working for every page.

<ion-split-pane when="(min-width: 768px)">
<ion-menu [content]="content">
  <ion-content id="Chat">
  </ion-content>
</ion-menu>
<ion-nav [root]="rootPage" #content></ion-nav>
</ion-split-pane>
like image 963
Ajoy Karmakar Avatar asked Apr 12 '17 12:04

Ajoy Karmakar


1 Answers

    import { Component } from '@angular/core';
    import { MenuController,IonicPage, NavController } from 'ionic-angular';

    @IonicPage()

    @Component({
      selector: 'page-signup',
      templateUrl: 'signup.html',
    })

    export class SignUp {

    constructor(public navCtrl: NavController, public menu : MenuController) 
    {   
       this.menu.enable(false);
       this.menu.swipeEnable(false);
    }

    ionViewWillLeave(){
    this.menu.enable(true);
    this.menu.swipeEnable(true);
    }
  }

Hope this helps. just disable menu and swipe the menu with that splitpane automatically hides.

like image 140
Dhaval Thakkar Avatar answered Oct 12 '22 12:10

Dhaval Thakkar