angularjs的循环遍历


<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="css/amazeui.min.css">
    <script src="js/jq2.js"></script>
    <script src="js/amazeui.min.js"></script>
    <script src="js/angular.min.js"></script>
</head>
<body ng-app="myapp">
    <div ng-controller="news">
        <ul class="am-avg-sm-8">
            <li>序号</li>
            <li>姓名</li>
            <li>年龄</li>
            <li>性别</li>
            <li>党员</li>
            <li>是否是首条</li>
            <li>是否是尾条</li>
            <li>不属于前尾</li>
        </ul>
        <ul class="am-avg-sm-8" ng-repeat="c in data">
            <li>{{$index}}</li>
            <li>{{c.name}}</li>
            <li>{{c.age}}</li>
            <li>{{c.sex}}</li>
            <li>{{c.dang == "1"? "是":"否"}}</li>
            <li>{{$first ? "是":"否"}}</li>
            <li>{{$last ? "是":"否"}}</li>
            <li>{{$middle ? "是":"否"}}</li>
        </ul>
    </div>
</body>
<script>
    var app = angular.module('myapp',[]);
    app.controller('news',function($scope){
       $scope.data = [
           {name:"小一",age:"11",sex:"",dang:"1"},
           {name:"小二",age:"22",sex:"",dang:"1"},
           {name:"小三",age:"33",sex:"",dang:"2"},
           {name:"小四",age:"44",sex:"",dang:"2"},
           {name:"小五",age:"55",sex:"",dang:"1"},
           {name:"小六",age:"66",sex:"",dang:"2"},
           {name:"小七",age:"77",sex:"",dang:"1"},
           {name:"小八",age:"33",sex:"",dang:"2"}
       ];
    });
</script>
</html>


阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页