Created
September 23, 2014 14:06
-
-
Save hirokazumiyaji/9d5bcf6076b1ed62debf to your computer and use it in GitHub Desktop.
angularjs sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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