Hey guys,
having 2 states, root one and it’s child one
$stateProvider.state('main', {
url: '/main',
templateUrl: 'main.html',
controller: 'MyCtrl'
});
$stateProvider.state('main.content', {
url: '/content',
views: {
content: {
templateUrl: 'main-content.html',
controller: 'MyCtrl'
}
}
});
and the markup for main state looking like this
<ion-nav-bar class="bar-positive">
</ion-nav-bar>
<ion-tabs class="tabs-positive">
<ion-tab icon="ion-home" ui-sref="main.content">
<ion-nav-view name="content"></ion-nav-view>
</ion-tab>
</ion-tabs>
when I wanna switch to the main
state using $state.go('main')
, I end up being in the main.content
state instead. What is the reason for this? Is it because of the nested nav-view so it’s looking for a child state and switches to it?
Thanks in advance