AngularJS-repeat指令

<body ng-app="myApp">
	<div ng-controller="myCtrl">
		<ul>
			<li ng-repeat="per in data">
				<span>姓名:{{per.name}}</span>
				<span>姓名:{{per.sex}}</span>
				<span>姓名:{{per.age}}</span>
			</li>
		</ul>
	</div>
	<script>
		var app = angular.module('myApp', []);
		app.controller("myCtrl", ['$scope', function (scope) {
			scope.data = [
				{'name': 'handsome', 'sex': '男', 'age': 21},
				{'name': 'handsome', 'sex': '男', 'age': 21},
				{'name': 'handsome', 'sex': '男', 'age': 21},
				{'name': 'handsome', 'sex': '男', 'age': 21},
			];
		}]);
	</script>
</body>

  

原文地址:https://www.cnblogs.com/handsomehan/p/6144487.html