我有一个表格:
<div class="container" ng-app="sortApp" ng-controller="mainController">
<table class="table table-bordered ">
<thead>
<tr>
<td>
<a href="#" ng-click="sortType = 'name'; sortReverse = !sortReverse">
Sushi Roll
</a>
</td>
<td>
<a href="#" ng-click="sortType = 'fish'; sortReverse = !sortReverse">
Fish Type
</a>
</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="roll in sushi | orderBy:sortType:sortReverse | filter:searchFish">
<td>{{ roll.name }}</td>
<td>{{ roll.fish }}</td>
</tr>
</tbody>
</table>
</div>
这里是控制器:
angular.module('sortApp', [])
.controller('mainController', function($scope) {
$scope.sortType = 'name'; // set the default sort type
$scope.sortReverse = false; // set the default sort order
$scope.searchFish = ''; // set the default search/filter term
// create the list of sushi rolls
$scope.sushi = [
{ name: 'Cali Roll', fish: 'Crab' },
{ name: 'Philly', fish: 'Tuna' },
{ name: 'Tiger', fish: 'Eel' },
{ name: 'Rainbow', fish: 'Variety' }
];
});
这里有一个Fiddler。
我想使用ng-mouseover
指令,在鼠标悬停时突出显示表格行的边框。
我该如何实现?
ng-mouseover
去实现只能通过 CSS 实现的效果呢? - Lorenzo Marcon:hover
选择器吗? - Akshay Khandelwal