嗨我在ng-repeat中有下表
<div ng-repeat ="item in items">
<span>{{item.name}}></span>
<span>{{item.age}}></span>
</div>
我想做的是 鼠标悬停的每一行都会突出显示并可单击以将项目传递给进一步处理。
请告诉我如何实现这一目标
答案 0 :(得分:5)
CSS
.hoverme:hover
{
background-color:yellow;
}
.clicked
{
background-color:green;
}
JS
<div class="hoverme" ng-repeat ="item in items" ng-click="doSomething(item)" ng-class="{clicked:rowClicked==item}">
<span>{{item.name}}></span>
<span>{{item.age}}></span>
</div>
<强>更新强>
示例plunker