1. 程式人生 > >ng-repeat循環遍歷的用法

ng-repeat循環遍歷的用法

-i -a 打印 用法 ini in use bin 循環 bsp

ng-repeat循環遍歷的用法

    <script src="../angular-1.5.5/angular.min.js"></script>
</head>
<body ng-app="" ng-init="useName=[{id:1,name:‘狗‘},{id:1,name:‘貓‘}]">
<p ng-repeat="list in useName">//現遍歷相當於for in循環
{{list}} //相當於打印 (此時打印出來的是一個對象)
歡迎:<span ng-bind="list.name"></span>
</p>




</body>

ng-repeat循環遍歷的用法