Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
change css3
<!doctype html>
<html lang="en" ng-app>
<meta charset="UTF-8">
.selected {
background-color: lightgreen;
<table ng-controller='tableController'>
<tr ng-repeat='item in list'
ng-class='{selected: $index == selectedRow}'>
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="main.js"></script>
function tableController($scope) {
$scope.list = [
{name: 'houyao', age: 12},
{name: 'liurui', age: 22},
{name: 'daxue', age: 42}
$scope.selectItem = function(row) {
$scope.selectedRow = row;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.