首页 > 其他 > 详细

选中行高亮

时间:2014-04-28 23:47:29      阅读:592      评论:0      收藏:0      [点我收藏+]

<style>
.selected{background-color: lightgreen;}
</style>

 

<body>
<table ng-controller="restaurantTableController">
<tr ng-class="{selected:$index==selectedRow}" ng-repeat=‘restaurant in directory‘ ng-click="selectRestaurant($index)">
<td>{{restaurant.name}}</td>
<td>{{restaurant.cuisine}}</td>
</tr>
</table>

</body>

 

<script>
var app=angular.module("myApp",[]);

app.controller("restaurantTableController",function($scope){
$scope.directory=[{name:‘hongshu‘,cuisine:‘bbq‘},{name:‘gee‘,cuisine:‘slad‘},{name:‘sbnm‘,cuisine:‘dffffrew‘}];
$scope.selectRestaurant=function(row){

$scope.selectedRow=row;
}
});
</script>

选中行高亮,布布扣,bubuko.com

选中行高亮

原文:http://www.cnblogs.com/java-php/p/3693007.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!