I can´t this navbar to show just one of the navbars, it shows both of them. What am I doing wrong?
View:
<!-- Logged in -->
<div ng-show="loggedIn">
Navbar logged in
</div>
<!-- Logged out-->
<div ng-hide="!loggedIn">
Navbar logged out
</div>
</div>
</nav>
Controller:
.controller('mainCtrl', ['$scope', '$state', 'userService',
function($scope, $state, userService) {
$scope.loggedIn = userService.isLoggedIn();
$scope.login = function() {
userService.login();
$state.go('home');
};
$scope.logout = function() {
userService.logout();
$state.go('login');
};
}
]);