ng-repeat指令的使用

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script>
	</head>
	<body>
		<div ng-app="" ng-init="names=[
			{name:'star',age:'18'},
			{name:'ronnie',age:'19'},
			{name:'lisa',age:'20'},
		]">
			<ul>
				<li ng-repeat="x in names">
					{{x.name+','+x.age}}
				</li>
			</ul>
		</div>
	</body>
</html>

posted @ 2019-05-07 16:48  lxystar  阅读(367)  评论(0编辑  收藏  举报