AngularJS ng-repeat的使用

前端之家收集整理的这篇文章主要介绍了AngularJS ng-repeat的使用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
特有属性

$index,$first,$last

<!DOCTYPE html>
<html lang="en">
<head>
    <Meta charset="UTF-8">
    <title>AngularJS</title>

    <link rel="stylesheet" href="css/foundation.min.css">
    <style type="text/css">
        .tx {
            width: 50px;
            height: 50px;
            margin-bottom: 10px;
            magin-left: 80px;
        }
    </style>
</head>
<body ng-app="app" ng-controller="AddressCtrl">
    <div style="padding:10px; font-weight:bold" >地址管理</div>
    <ul class="ui-list ui-list-link ui-list-text ui-list-active ui-border-tb">
        <li ng-repeat="item in list" class="ui-border-t">
            <h4>{{$index+1+'.'+item.address + $first +' '+ $last}}</h4>
        </li>
    </ul>
</body>
<script src="js/angular.min.js"></script>
<script src="app.js"></script>
</html>

angular.module('app',[])
.controller('AddressCtrl',function ($scope) {
    $scope.list = [
        {id:1,address:'1'},{id:2,address:'2'},{id:3,address:'3'},{id:4,address:'4'}
    ];
})

猜你在找的Angularjs相关文章