0
In this plunk我有三個從數組創建的選項卡。當我點擊按鈕時,我需要選擇名爲「名稱1」的那個,並有焦點。這怎麼能實現?如何以編程方式選擇Angular UI上的選項卡?
HTML
<uib-tabset>
<uib-tab ng-repeat="t in tabs" heading="{{t.title}}" >
{{t.content}}
</uib-tab>
</uib-tabset>
<br/><br/><br/>
<button ng-click="tabs.select(1)">Focus on Name 1</button>
的Javascript
$scope.tabs = [
{ title:'Name 0', content: "Content 0" },
{ title:'Name 1', content: "Content 1" },
{ title:'Name 2', content: "Content 2" }
];