matias
April 2, 2014, 8:40pm
1
I have an app where my first screen is a login, then when the user logs in I redirect my app to another view using $state.go('app.foo');
The problem is that in my ion-nav-bar
I see the ion-nav-back-button
, but I don’t want it when the user comes from the login.
Any ideas?
Thanks!
1 Like
matias
April 3, 2014, 2:09am
3
I didn’t know about that. But how can I use it with Javascript? I am redirecting to another view using $state.go('app.foo');
only after that redirection I don’t want the back button.
Can you just apply it to whatever button causes that state change?
If not, then here is the navClear
directive. Take it’s code and apply in your controller.
.directive('navClear', ['$ionicViewService', function($ionicViewService) {
return {
restrict: 'AC',
link: function($scope, $element, $attr) {
$element.bind('click', function(){
$ionicViewService.nextViewOptions({
disableAnimate: true,
disableBack: true
});
});
}
};
}]);
1 Like
matias
April 3, 2014, 10:34pm
5
Ok, thanks @darrenahunter and @Calendee
Didn’t know about this nav-clear
matias
April 4, 2014, 11:47pm
7
Thanks! It really help me.