【发布时间】:2016-12-28 15:09:59
【问题描述】:
查看:
<a ng-repeat="control in controls | filter:name" ng-href="#{{control.id}}" ng-click="restart(control.name)" ng-class="{active: control.name == selected}">{{control.name}}
控制器- app.js
$scope.restart = function (controlName) {
$scope.selected = controlName;
}
在这里,我在单击时添加了活动类。如何使用鼠标悬停添加悬停类并使用鼠标离开删除类。
【问题讨论】:
-
使用
ngMouseover和ngMouseleave -
我用过..但我想在点击时添加活动类。我想在悬停时添加“悬停”类。
标签: angularjs mouseover ng-repeat angularjs-ng-click mouseleave