Hi, I’m developing an app where the user first comes to home screen like this
.state(‘home’, {
url: ‘/’,
templateUrl: ‘templates/home.html’,
controller: ‘HomeCtrl’
})
and then user goes to login view
.state(‘login’, {
url: ‘/login’,
templateUrl: ‘templates/login.html’,
controller: ‘LoginCtrl’
})
from login view if user successfully logins, then I do
$ionicHistory.clearHistory();
$ionicHistory.nextViewOptions({
disableBack: true,
historyRoot: true
});
and then take user to dashboard page using
$state.go(‘tab.dash’, {}, {location:“replace”, reload:true});
Dashboard view in app.js is like
.state(‘tab.dash’, {
url: ‘/dash’,
views: {
‘tab-dash’: {
templateUrl: ‘templates/tab-dash.html’,
controller: ‘DashCtrl’
}
}
})
Now the problem is that on dashboard page the back button works and takes user to home state.
Does anybody know how to solve this problem?
Thanks a lot for your help in advance.