发布于 2017-05-01 23:25:01 | 203 次阅读 | 评论: 0 | 来源: 网友投递
这里有新鲜出炉的AngularJS开发指南,程序狗速度看过来!
AngularJS 前端JS框架
AngularJS诞生于Google是一款优秀的前端JS框架,已经被用于Google的多款产品当中。AngularJS有着诸多特性,最为核心的是:MVC、模块化、自动化双向数据绑定、语义化标签、依赖注入,等等。
AngularJS 使用ng-repeat报错
[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uniq
ng-repeat报错
<div ng-init="words = ['高校','高校','高校']" ng-repeat="word in words">
{{word}}
</div>
[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys
发现是因为相同的内容重复引起,解决方案
<div ng-init="words = ['高校','高校','高校']" ng-repeat="word in words track by $index">
{{word}}
</div>
在ng-repeat后面加上
track by $index
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!