我有一个基于angular ui bootstrap的手风琴列表,如下所示:
<div ng-controller="AccordionCtrl">
<accordion close-others="oneAtTime">
<accordion-group is-open="l3payOpen">
<accordion-heading>
<span>
<img class="marginleft" src="/web/bundles/lima3main/images/icon-l3play.png">
L3 Pay
<span class="img-submenu" ng-class="{'imgplus': !l3payOpen, 'imgminus': l3payOpen}"></span>
</span>
</accordion-heading>
<ul class="accordion-ul">
<li class="accordion-li" ng-class="{active:isActive('/singlepayment')}">
<a href="#/singlepayment" id="single-payment">
<img class="marginleft" src="/web/bundles/lima3main/images/icon-singlepayment.png">
Single payment
</a>
</li>
<li class="accordion-li" ng-class="{active:isActive('/recurringbilling')}">
<a href="#/recurringbilling" id="recurring-billing">
<img class="marginleft" src="/web/bundles/lima3main/images/icon-recurringbilling.png">
Recurring Billing
</a>
</li>
</ul>
</accordion-group>
<accordion-group is-disabled="true">
<accordion-heading >
<span id="l3-bridge" ng-click="redirect('l3bridge')">
<img class="marginleft" src="/web/bundles/lima3main/images/icon-l3bridge.png">
L3 Bridge
</span>
</accordion-heading>
</accordion-group>
</accordion>
</div>
所以,这支手风琴就像这样:
如果可以看到,ng-class
中有li tag
名为isActive的适用:
$scope.isActive = function(route) {
return route === $location.path();
}
因此,当您点击任何li
时,该课程完美无缺:
所以,问题是当我在没有li
标签的其他手风琴组中应用ng-class时。我不能将它应用于span标签,因为样式显示如下:
我能做些什么吗?