Skip to content

Instantly share code, notes, and snippets.

@gujc71
Last active February 15, 2018 15:03
Show Gist options
  • Save gujc71/8b9fe4bae7c67ed58a49b1ecb33ea833 to your computer and use it in GitHub Desktop.
Save gujc71/8b9fe4bae7c67ed58a49b1ecb33ea833 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
<title>Board Sample</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script>
// data list based on array
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.boardlist = [
{id: 1, title: 'Title1', writer: 'Writer1'},
{id: 2, title: 'Title2', writer: 'Writer2'}
];
});
</script>
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<table border="1">
<tr>
<td style="width: 50px">No.</td>
<td style="width: 200px">Title</td>
<td style="width: 50px">Name</td>
</tr>
<tr ng-repeat="item in boardlist">
<td style="width: 50px">{{$index+1}}</td>
<td style="width: 200px">{{item.title}}</td>
<td style="width: 50px">{{item.writer}}</td>
</tr>
</table>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment