It may be hard to explain but i will try: Im using ionic framework and ui-router in my app and have following situation:
.state('tab.promoAward', {
url: "/promoAward/:id",
views: {
'tab-search': {
templateUrl: 'templates/customer/promoAward.html',
controller: 'promoAwardCtrl',
},
'tab-favourites': {
templateUrl: 'templates/customer/promoAward.html',
controller: 'promoAwardCtrl',
},
},
})
As you can see, i want display the same child view (awards) for other parent tabs (search, and favourites). Above example working but if i am on tab-search state when call promoAwardCtrl then application automatilcy going to tab-favourites (i want stay in tab-seach state) state and I losing "back button" (to prevoius state).
Any ideas how to resolve this problem?
/**************EDIT***************/
Solution is:
.state('tab.promoAward', {
url: '/promoAward/:id',
views: {
'':{
},
'tab-search@tab': {
controller: 'promoAwardCtrl',
templateUrl: 'templates/customer/promoAward.html'
},
'tab-favourites@tab': {
controller: 'promoAwardCtrl',
templateUrl: 'templates/customer/promoAward.html'
},
},
})
Thanks for all replies
cannot be done, see this post in the ionic forums http://forum.ionicframework.com/t/creating-shared-routes-in-different-views/3955
In angular ui routing I used multiple child views for same parent. but not sure its possible in your case. One suggestion is put parent:"name of parent" in child views might work.