-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestTable.html
More file actions
27 lines (26 loc) · 989 Bytes
/
restTable.html
File metadata and controls
27 lines (26 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<html ng-app>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="styles/styles.css" />
<title>Restaurant Table highlight</title>
</head>
<body>
<table ng-controller="RestaurantTableController">
<tr ng-repeat="restaurant in directory" ng-click="selectRestaurant($index)"
ng-class="{selected: $index==selectedRow}">
<td>{{restaurant.name}}</td>
</tr>
</table>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>
<script>
function RestaurantTableController($scope) {
$scope.directory = [{name: "The Handsome Heifer", cuisine:"BBQ"},
{name: "Green's Green Green's", cuisine: "Salads"},
{name: "House of Fine Fish", cuisine:"seafood"}];
$scope.selectRestaurant = function (row) {
$scope.selectedRow = row;
}
}
</script>
</body>
</html>