I would to make something like this:
.state('tabs.order', {
url: "/order/:orderId",
views: {
'orders-tab': {
templateUrl: "templates/orderDetail.html",
controller: 'OrderDetailController'
},
'orders-all-tab': {
templateUrl: "templates/orderDetail.html",
controller: 'OrderDetailController'
}
}
})
then in my view i would to put a conditional ui-sref in which i can choose the tab to be addressed; something like this:
ui-sref="tabs.order({orderId:order.ID}, <orders-tab or orders-all-tab?>)"
would this be possible? Thanks
Well, I don't think there is any way yet to specify the view in
ui-sref
, but here is a starting point which I hope it will help you..Firstly, the routes:
Then, define your main page (Orders and Order Details) [main.html]
And the page controller to specify the tab data:
All you have to do next is to include the
orderID
.Here is a demo