Hi all,
I have 2 views as follows
.state('tab.matches', {
url: '/matches',
views: {
'tab-matches': {
templateUrl: 'templates/bant-tab-matches.html',
controller: 'MatchesCtrl'
}
}
})
.state('tab.matches-detail', {
url: '/matches/:matchId/:userId/:userName',
views: {
'tab-matches': {
templateUrl: 'templates/bant-tab-matches-detail.html',
controller: 'MatchesDetailCtrl'
}
}
})
I have a button on a different view which on click calls a function in the controller as follows:
$scope.messageUser = function (postInfo) {
$state.go('tab.matches-detail', { matchId: var1, userId: var2, userName: var3 });
}
This redirects to the tab.matches-detail
view as expected but a back button is not present. I would like the back button to redirect back to the parent view being tab.matches
, or the view I originally redirected from. If I navigate from tab.matches
to tab.matches-detail
(when I have not redirected by $state.go
) the back button is present. I however am going direct to tab.matches-detail
when $state.go
is called. As such I can no longer access tab.matches
as if I click on another tab and then return to tab.matches
it displays tab.matches-detail
with no way to access the parent state of tab.matches
. I can’t figure out how to get the back button to display. I need this to be controlled from the controller rather than a href in the view as I need to call similar functionality from an Actionsheet where the logic is all controller side.
Apologies for the rather verbose explanation but I want to be clear on the issue.
Thanks in advance for your help.
Anthony