将数据传递给uib-accordion-group

时间:2019-01-25 14:55:21

标签: angularjs angularjs-directive angular-ui-bootstrap accordion bootstrap-accordion

我有以下代码:

<div class="item">
  <div class="row">
    <!-- ELEMENT 1 -->
    <!-- ELEMENT 2 -->
    <!-- ELEMENT 3 -->
  </div>
</div>
<div class="item">
  <div class="row">
    <!-- ELEMENT 4 -->
    <!-- ELEMENT 5 -->
    <!-- ELEMENT 6 -->
  </div>
</div>

<div uib-accordion-group class="panel-default" is-open="isOpen" template-url="group-template.html"> <uib-accordion-heading> Custom Title </uib-accordion-heading> </div> 中,我有以下代码:

group-template.html

如何将<h4 class="panel-title" uib-accordion-transclude="heading"> <span uib-accordion-header>{{heading}}</span> <div ng-switch="varCondition"> <i class="a" ng-switch-when="1"/> <i class="b" ng-switch-when="2"/> </div> </h4> 变量作为varCondition参数传递?

1 个答案:

答案 0 :(得分:0)

在html模板内部尝试更改

ng-switch="varCondition"

进入

ng-switch="$parent.varCondition"

Here is a working plunkr