2015-04-12 41 views
0

選項卡處於活動我創建的標籤如何讓選擇在引導

<ul ng-init="tab = 1" class="nav nav-tabs" role="tablist" style="margin-top:10px;"> 
    <li class="active"><a ng-click="tab = 1">1. Shopping cart</a></li> 
    <li><a ng-click="tab = 2">2. Delivery Address</a></li> 
    <li><a ng-click="tab = 3">3. Place Order</a></li> 
</ul> 

第一個選項卡下面的代碼是活動的,看起來是這樣的。

enter image description here

但是,當我選擇第二個,第三個標籤,它不是趨於活躍。如何使選定的選項卡處於活動狀態並將其全部停用

回答

0
<ul ng-init="tab = 1" class="nav nav-tabs nav-justified" role="tablist" style="margin-top:10px;"> 
    <li ng-class="{active:tab==1}"><a data-toggle="tab" ng-click="tab = 1">1. Shopping cart</a></li> 
    <li ng-class="{active:tab==2}"><a data-toggle="tab" ng-click="tab = 2">2. Delivery Address</a></li> 
    <li ng-class="{active:tab==3}"><a data-toggle="tab" ng-click="tab = 3">3. Place Order</a></li> 
</ul>