I\'m new to Ionic 2 & Angular2 and I have downloaded a new Ionic template with the following command
Ionic start appname sidemenu --v2 --ts
I think the drag-content
directive is used in ionic 1, for Ionic 2 what you can do is disable it from within your page class file.
You can do this by importing the MenuController
provider from ionic-angular
and then call the .swipeEnable(shouldEnableBoolean, menuId)
method to disable the swipe gesture within your page's class (this is also documented here).
Your login controller should be something like this...
import {Page, MenuController} from 'ionic-angular';
@Page({
templateUrl: 'build/pages/home/home.html'
})
export class HomePage {
constructor(public menu: MenuController) {
this.menu.swipeEnable(false);
}
}
If you have multiple menus and each one has an id then you can target a specific menu like this...
this.menu.swipeEnable(false, `menuId`);
You can disable/enable sidemenu at any time at any page by calling
$ionicSideMenuDelegate.canDragContent(false)
e.g:
angular.module('ABC').controller('xyzCtrl', function($scope, $ionicSideMenuDelegate) {
$ionicSideMenuDelegate.canDragContent(false)
});