I’m trying to use the Bootstap.Tabs component to create some bootstrap tabs.
I’ve declared the tabs as follows:
{{view Bootstrap.Tabs
contentBinding="App.tabsContent"
selectionBinding="App.selection"}}
And I’m using the following code to set up the content for the tabs.
App.ready = function() {
App.tabsContent= Ember.A([{value: "cred_app.associate_clients", title: "Associate clients"}, {value: "cred_app.facilities", title: "Facilities"}]);
};
Using this I can successfully render the bootstrap tabs.. and the route name pops up in App.selection.
I just don’t understand how to get the links working, so that controller will transition to the route. I’d also like to get the active tab get the correct css applied to it so that the tabs show which route is currently being displayed.
UPDATE:
I have implemented this using a more simplistic approach:
<ul class='nav-tabs'>
{{#linkTo 'cred_app.associate_clients' model tagName='li' href=false}}
{{#linkTo 'cred_app.associate_clients' model}}Client Hierachy{{/linkTo}}
{{/linkTo}}
</ul>
You can do something like this:
(using my derived Bootstrap.Tabs implementation)
or using the router:
the magic is done by the Bootstrap.TabItem, it gets the active state from the linkTo helper
now you only need a router, something like this:
a jsFiddle might help