Ionic - How to remove sidemenu on login page only?

前端 未结 17 2860
北海茫月
北海茫月 2020-12-08 09:25

I need to remove sidemenu only on my login page. Otherwise remain. How it can be done? I\'m using command ionic ionic start myApp sidemenu to create the project

17条回答
  •  囚心锁ツ
    2020-12-08 10:05

    Based on various answers here from everyone and 15 minutes of trying, here is my working example of it, and it should work as simply doing copy-paste

    Your view, like login.html

    
        
            

    Title

    Your related controller, like LoginCtrl

    function LoginCtrl($scope, $ionicSideMenuDelegate) {
    
        $scope.$on('$ionicView.afterEnter', function(event) {
            $ionicSideMenuDelegate.canDragContent(false);
        });
        //enable side menu drag before moving to next view
        $scope.$on('$ionicView.beforeLeave', function(event) {
            $ionicSideMenuDelegate.canDragContent(true);
        });
    }
    

提交回复
热议问题