如何绑定到新的Set和Map对象? [英] How to bind to the new Set and Map objects?
本文介绍了如何绑定到新的Set和Map对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
角度1. * ng重复使用设置
和 Map
新对象
Does angular 1.* ng-repeat work with Set
and Map
new objects?
有没有计划整合?
推荐答案
角度内部使用 for..in
运算符遍历非数组对象。 证明链接到来源。 映射
和 Set
不能通过这种方式迭代,它们应该通过迭代..of
。所以你不能使用这个集合 ng-repeat
而没有任何额外的转换。
Angular internally uses for..in
operator to iterate through non-array objects. Proof-link to the sources. Map
and Set
can't be iterated by this way, they should be iterated via for..of
. So you can't use this collections for ng-repeat
without any extra conversions.
即将到来的角度2有ES6功能支持,并且具有重复的语法。有关详细信息,请参见角度2文档。
Upcoming Angular 2 have ES6 features support and it have for..of syntax in repeat too. See angular 2 docs for more details.
这篇关于如何绑定到新的Set和Map对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文