<html ng-app="myApp">
<head>
<title>angularjs-demo</title>
<link href="bootstrap.min.css" rel="stylesheet">
<link href="index.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/angular.js/1.6.4/angular.js"></script>
</head>
<body ng-controller="ctrl">
<div class="table-responsive">
<table class="table table-striped table-sm">
<tbody>
<thead>
<tr>
<th>课程</th>
<th>网址</th>
<th>学籍</th>
</tr>
</thead>
<tr ng-repeat="item in items">
<td>{{item.Name}}</td>
<td>{{item.Url}}</td>
<td>{{item.Country}}</td>
</tr>
<tr>
<td>1,002</td>
<td>amet</td>
<td>consectetur</td>
</tr>
</tbody>
</table>
</div>
</main>
</div>
</div>
<script>
var app = angular.module('myApp',[]);
app.controller("ctrl",function($scope,$location){
$scope.items = getStu();
});
function getStu() {
return [ {
"Name": "菜鸟教程",
"Url": "www.runoob.com",
"Country": "CN"
},
{
"Name": "Google",
"Url": "www.google.com",
"Country": "USA"
},
{
"Name": "Facebook",
"Url": "www.facebook.com",
"Country": "USA"
},
{
"Name": "微博",
"Url": "www.weibo.com",
"Country": "CN"
}];
}
</script>
</body>
</html>
<!-- {
"sites": [
{
"Name": "菜鸟教程",
"Url": "www.runoob.com",
"Country": "CN"
},
{
"Name": "Google",
"Url": "www.google.com",
"Country": "USA"
},
{
"Name": "Facebook",
"Url": "www.facebook.com",
"Country": "USA"
},
{
"Name": "微博",
"Url": "www.weibo.com",
"Country": "CN"
}
]
} -->