Last active
February 15, 2018 15:03
-
-
Save gujc71/8b9fe4bae7c67ed58a49b1ecb33ea833 to your computer and use it in GitHub Desktop.
This file contains 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 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