Skip to content

Instantly share code, notes, and snippets.

@hirokazumiyaji
Created September 23, 2014 14:06
Show Gist options
  • Save hirokazumiyaji/9d5bcf6076b1ed62debf to your computer and use it in GitHub Desktop.
Save hirokazumiyaji/9d5bcf6076b1ed62debf to your computer and use it in GitHub Desktop.
angularjs sample
<!doctype html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"></script>
<script type="text/javascript">
function tableController($http, $scope) {
$scope.records = [
{
id: 1,
name: 'John',
age: 19
},
{
id: 2,
name: 'Alice',
age: 20
}
];
}
</script>
</head>
<body>
<div ng-app>
<div ng-controller="tableController">
<table>
<tr>
<td>ID</td>
<td>Name</td>
<td>Age</td>
</tr>
<tr ng-repeat="record in records track by $index">
<td ng-repeat="column in record">
{{ column }}
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment