sdr001
December 17, 2013, 3:08pm
1
Hello, I am very new to ionic and I am loving it so far. I have a question on different looking screens. I will basically have two screens (login/signup) without a tab bar and the rest will. How can I have two different views? Thank you in advanced.
Sean
adam
December 17, 2013, 4:16pm
2
That exact problem is something I’m tackling right now. Hang tight!
1 Like
Hi!
Had the same issue. A quick workaround: add an ng-show to your div containing the tabs in your main.html:
<div class="tabs tabs-global tabs-icon-top" ng-show="pathisnotlogin">
<a class="tab-item" href="#/vinibar">
<i class="icon ion-home"></i>
Vinibar
</a>
</div>
And then, in your app’s main controller, watch for a route change and update the $scope.pathisnotlogin to true when you are not in these two views:
.controller('MainCtrl', function($scope, , $route, $location) {
$scope.$on('$routeChangeSuccess', function() {
var path = $location.path();
console.log(path);
$scope.pathisnotlogin = true;
if(path === '/login') {
$scope.pathisnotlogin = false;
} else {
$scope.pathisnotlogin = true;
}
});
});
2 Likes
gbox
February 7, 2014, 4:17pm
4
Has anyone found a solution for this yet?
I’m currently battling with the side menu. While my login page doesn’t have one all other pages have a side menu.
I guess I could just display nothing in the side menu but I would prefer to have no side menu at all until a successful login.
adam
February 7, 2014, 5:20pm
5
I put together a demo here that may help:
gbox
February 7, 2014, 11:00pm
6
Wow, that’s great Adam. Thank you so much.
I thought it might come down to using an abstract state.
I think that’s certainly a good option for the tabs but it doesn’t feel right for me when it comes to the side menu.
adam
February 9, 2014, 7:32pm
7
Have you come across this side menu demo yet?
http://codepen.io/ionic/pen/EtbrF
http://codepen.io/ionic/public-list : You can go through all these samples for different ideas.