<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>
时间: 2024-11-01 03:36:14