How to hide side menu in conditionally in ionic?

in my app i don’ t want to show a side menu in all pages i tried this below code but still side menu show in all pages

> $scope.$on('$ionicView.beforeEnter', function (event) {
>  
>   $ionicSideMenuDelegate.canDragContent(false);
> });

> $scope.$on('$ionicView.beforeLeave', function (event) {
>   
>   $ionicSideMenuDelegate.canDragContent(true);
> });

thanks,