使用AngularJS ui-bootstrap向手风琴标题添加类? [英] Add class to accordion heading using AngularJS ui-bootstrap?
本文介绍了使用AngularJS ui-bootstrap向手风琴标题添加类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用 ng-class
有条件地将一个类添加到手风琴标题
,但是看来甚至不会保留在元素上显式设置的类。我有这个:
I want use ng-class
to conditionally add a class to the accordion-heading
, but it appears that not even setting a class explicitly on the element gets preserved. I have this:
<div accordion close-others="true">
<div ng-repeat="currItem in items" accordion-group>
<div accordion-heading class="myClass">My Heading {{$index}}</div>
<div class="accordion-inner myClass">asdf asdf asdf</div>
</div>
</div>
和小提琴: http://jsfiddle.net/Zmhx5/1/
当我检查手风琴标题元素时,该类 myClass
找不到。
When I inspect the accordion heading element, the class myClass
is nowhere to be found. Is there some reason I can't add classes to the accordion heading?
推荐答案
您可以将CSS放入指令<$内吗? c $ c>手风琴标题标签:
You can put the CSS inside the directive accordion-heading
tags:
<accordion-heading>
<div class="myClass">My Heading {{$index}}</div>
</accordion-heading>
这篇关于使用AngularJS ui-bootstrap向手风琴标题添加类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文