在悬停时在ng-repeat中添加“活动”类

时间:2016-12-14 14:27:15

标签: angularjs angularjs-ng-repeat

您好我有以下代码:

div( ng-repeat='cladding in claddings track by $index' ui-sref='app.protected.docInside.cladding({documentId, claddingId: cladding.id})')
   div(ng-if='!cladding.deleteFlag')
       .doc-child-img
       p {{cladding.name}}
       element-dropdown(type='"cladding"')
       .clearfix
   del(ng-if='cladding.deleteFlag')
       .doc-child-img
       p {{cladding.name}}
       element-dropdown(type='"cladding"')
       .clearfix

如何设置为div(ng-if ='!cladding.deleteFlag')和del(ng-if =' cladding.deleteFlag') 在悬停时ng类'活动'??

1 个答案:

答案 0 :(得分:1)

您可以将新事件注册到DOM元素

ng-mouseover&& ng-mouseleave with ng-class

获取当前悬停项目,然后将属性添加到其中,例如'hover'

这里的例子 open var superview: UIView? { get }