<!DOCTYPE html>
<html ng-app="my_app">
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript">
var app = angular.module("my_app", []);
app.controller('my_controller', function($scope) {
//列名
$scope.keys = ['studentno', 'studentname', 'address'];
//内容
$scope.students = [{
studentno: 's001',
studentname: '学生1',
address: '浙江',
},
{
studentno: 's002',
studentname: '学生2',
address: '浙江',
},
{
studentno: 's003',
studentname: '学生3',
address: '浙江',
},
];
});
</script>
</head>
<body ng-controller="my_controller">
<div>
<ul>
<li ng-repeat="item in students">
<span ng-repeat="key in keys">
<span ng-if="item[key]&&item[key].length" ng-bind="item[key]">
</span>
</span>
</li>
</ul>
</div>
</body>
</html>