单击 link 时重定向到选项卡

redirect to tab when the link is clicked

<uib-tabset active="selectedTab"> 
<uib-tab index="0" id="termsAndCondiotionTab" heading="TnCs">
<div class="panel-body">        
<form name="TandC" ng-submit="saveTermsAndConditions()">
<input type="radio" type="radio">Yes
<input type="radio" type="radio">No
<button type="submit" id="conditionSubmit" class="bin btn-primary">NEXT</button>                            
</uib-tab>
<uib-tab index="1" id="infrastructureTab" heading="Infrastructure ">
<div class="panel-body">        
    <form name="Infrastructure" ng-submit="saveInfrastructure()">
    <label>Terms and Conditions </label>
        <input type="radio" ng-model="object.infrastructure" type="radio">Yes
        <input type="radio" ng-model="object.infrastructure" type="radio">No
        <button type="submit" id="infraSubmit"  class="btn btn-primary">NEXT</button>
        </div>
</uib-tab>
</uib-tabset>

已使用标签集创建了 5 个标签。第 5 个选项卡是其余 4 个选项卡的摘要。在第 5 个选项卡中有 links。单击每个 link 应打开相应的选项卡。如何使用angular js实现?

解决方法是在angularUI tabset 中操作active 参数。您所需要做的就是以某种方式将标签的 ID 传递给标签集以激活。

https://angular-ui.github.io/bootstrap/#/tabs

您可以简单地从 ng-click 调用一个函数 传递标签索引,这将改变 已选择选项卡

因为您已经为每个选项卡编写了函数,以防它被激活。不用再写路由代码了