运行on-select的Angular-Ui Bootstrap TabSet

时间:2015-07-13 09:37:11

标签: angularjs angular-ui angular-ui-tabset

我正在为AngularJS使用Angular-Ui Bootstrap Tabset。我有8个不同的选项卡,所有这些选项卡在单击时都会运行。激活的选项卡根据对象属性在控制器上定义。代码是这样的:

<tabset ng-if="paginaPronta">
  <tab heading="Histórico" active="activeTabs.historico" disabled="beforeNew" select="tabHistorico('html')">
    <div ng-include="includes.historico" class="row padding0"></div>
  </tab>
  <tab heading="Pedido" active="activeTabs.pedido" select="tabPedido('html')">
    <div ng-include="includes.pedido" class="row padding0"></div>
  </tab>
  <tab heading="Documentos" active="activeTabs.documentos" disabled="beforeNew" select="tabDocumentos('html')">
    <div ng-include="includes.documentos" class="row padding0"></div>
  </tab>
  <tab heading="Posse" active="activeTabs.posse" disabled="beforeNew" select="tabPosse('html')">
    <div ng-include="includes.posse"></div>                
  </tab>
  <tab heading="Despesas" active="activeTabs.despesas" disabled="beforeNew" select="tabDespesas('html')">
    <div ng-include="includes.despesas" class="row padding0"></div>
  </tab>
  <tab heading="Faturação" active="activeTabs.faturacao" select="tabFaturacao('html')">
    <div ng-include="includes.faturacao" class="row padding0"></div>
  </tab>
  <tab heading="Anexos" select="tabAnexos('html')">
    <div ng-include="includes.anexos" class="row padding0"></div>
  </tab>
  <tab heading="Relatório" active="activeTabs.relatorio" disabled="beforeNew" select="tabRelatorio('html')">
    <div ng-include="includes.relatorio"></div>
  </tab>
</tabset>

开始时一切正常,但是当我更改位置以导航到另一个页面时,会调用所有8个制表符函数(tabHistorico(),tabPedido(),tabPosse()...)

我没有在任何其他地方调用这些功能,我把&#39; html&#39;在每个函数中,他们在控制器上创建了一个console.log('tabHistorico: ' + phrase),并打印出tabHistorico: html。所以,我知道所有标签都已激活,我无法弄清楚原因......

0 个答案:

没有答案