Best way to navigation after login


#1

After a successful login, to navigate back home I do $state.go('app.home'); but that makes the ion-nav-back-button show which I don’t want because they shouldn’t be able to navigate back to the login. So I think I need to basically navigate in the controller with a nav-clear. Or am I completely missing something? Thanks!


Problem with navigation and sign in page
#2

I’m beginner in Ionic and I’m also have this problem with navigation between login and home pages.
How can resolve this problem today? Please help me.
Which decisions best we are have for today?

Thank you )!


#3

That’s right, it works pretty good. But i noticed i can even get back using the physical button, even if i cleared the history. How can avoid the back navigation?


#4

In the controller that handles the ‘app.home’ state add this to the top

$ionicViewService.clearHistory();

(you’ll need to include $ionicViewService as param to your controller)


#5

That seems to work but one thing I notice is. The app.home controller fades in from the right like it came from a view it can go back on. WIll adding nav-clear to the login form do it?


#6

Thank you! This decision (nav-clear) working nice!


#7

Did you implement the nav-clear in the controller or what did you do? I need to do it before a redirect after a form submit.