I have 4 tabs, each with it's own content. I open a modal. I would like to click a button in the modal and route the response in one of the 4 tabs. I am unable to do that. Any suggestions?
Here is my tab code.
<ion-tabs class="tabs-icon-top tabs-color-active-assertive">
<ion-tab title="Tab1" href="#/app/tab1">
<ion-nav-view name="tab-1"></ion-nav-view>
</ion-tab>
<ion-tab title="Tab2" href="#/app/tab2">
<ion-nav-view name="tab-2"></ion-nav-view>
</ion-tab>
<ion-tab title="Tab3" href="#/app/tab3">
<ion-nav-view name="tab-3"></ion-nav-view>
</ion-tab>
<ion-tab title="Tab4" href="#/app/tab4">
<ion-nav-view name="tab-4"></ion-nav-view>
</ion-tab>
Here is my routes
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('app', {
url: '/app',
abstract: true,
templateUrl: 'views/home.html',
controller: 'AppCtrl'
})
.state('app.tab1', {
url: '/tab1',
views: {
'tab-1': {
templateUrl: 'views/tab1.html',
controller: 'Tab1Ctrl'
}
}
})
.state('app.tab2', {
url: '/tab2',
views: {
'tab-2': {
templateUrl: 'views/tab2.html',
controller: 'Tab2Ctrl'
}
}
})
.state('app.tab3', {
url: '/tab3',
views: {
'tab-3': {
templateUrl: 'views/tab3.html',
controller: 'Tab3Ctrl'
}
}
})
.state('app.tab3.modalcontent', {
url: '/modalcontent',
views: {
'tab-3': {
templateUrl: 'views/modalcontent.html',
controller: 'Tab3Ctrl'
}
}
})
.state('app.tab4', {
url: '/tab4',
views: {
'tab-4': {
templateUrl: 'views/tab4.html',
controller: 'Tab4Ctrl'
}
}
}));
When click a button in the modal I use $state
$state.go('app.tab3.modalcontent');
I would expect the modalcontent.html load in tab-3 view, but nothing happens.I still see tab3.html loaded. What should I do?