标签:track style text var index names script module nbsp
在angular中使用ng-repeat时数组中有重复元素,要用item in items track by $index,不然会报错
<div class="" ng-init="names=[1,2,3,4,5,5]"> <p>循环对象:</p> <ul> <li ng-repeat="x in names track by $index"> {{ x }}</li> </ul> </div> <script type="text/javascript"> var app=angular.module(‘myApp‘,[]); </script>
在angular中使用ng-repeat时数组中有重复元素,要用item in items track by $index
标签:track style text var index names script module nbsp
原文地址:https://www.cnblogs.com/liuw-flexi/p/12083598.html