发表于: 2019-03-09 21:58:13
1 535
今天完成的事情:(一定要写非常细致的内容,比如说学会了盒子模型,了解了Margin)
ng-repeat 指令用于循环输出指定次数的 HTML 元素。
expression | 表达式定义了如何循环集合。
表达式实例规则:
x in records
(key, value) in myObj
x in records track by $id(x) |
<body ng-app="myApp">
<table ng-controller="myCtrl" border="1">
<tr ng-repeat="x in records">
<td>{{x.Name}}</td>
<td>{{x.Country}}</td>
</tr>
</table>
<script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.records = [
{
"Name" : "Alfreds Futterkiste",
"Country" : "Germany"
},
{
"Name" : "Berglunds snabbk",
"Country" : "Sweden"
},
{
"Name" : "Centro comercial Moctezuma",
"Country" : "Mexico"
},
{
"Name" : "Ernst Handel",
"Country" : "Austria"
}
]
});
</script>
</body>
明天计划的事情:(一定要写非常细致的内容)
学习
遇到的问题:(遇到什么困难,怎么解决的)
无
收获:(通过今天的学习,学到了什么知识)
同上
评论