【问题标题】:redirect to tab when the link is clicked单击链接时重定向到选项卡
【发布时间】:2016-12-16 09:09:31
【问题描述】:
<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>

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

【问题讨论】:

  • 为什么不探索路由提供者或 ui-router 功能?你为此做了什么?

标签: angularjs redirect ngroute route-provider angular-ui-tabset


【解决方案1】:

解决方法是在 angularUI tabset 中操作 active 参数。您需要做的就是传递一个 tab 的 id 以某种方式激活 tabset。

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

【讨论】:

    【解决方案2】:

    您可以简单地使用 ng-click 调用函数 传递选项卡索引,这将改变 选定标签

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

    【讨论】:

      猜你喜欢
      • 2015-05-19
      • 2017-04-29
      • 2011-11-18
      • 2021-09-27
      • 1970-01-01
      • 2011-11-05
      • 2020-11-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多