简体   繁体   English

Emberjs CollectionView从0.9.7.1变为1.0.pre?

[英]Emberjs CollectionView changes from 0.9.7.1 to 1.0.pre?

I had some code that connected an ArrayController with CollectionView that no longer works once I upgrade to 1.0.pre. 我有一些代码将ArrayController与CollectionView连接起来,一旦我升级到1.0.pre就不再有效了。

It seems that CollectionView no longer passes each element of the collection to its template view class? 似乎CollectionView不再将集合的每个元素传递给它的模板视图类?

I've distilled my issue to this jsFiddle: http://jsfiddle.net/chaodoze/CbwCN/ 我把我的问题提炼到这个jsFiddle: http//jsfiddle.net/chaodoze/CbwCN/

Notice it outputs to "1,2,3" on each line in 1.0.pre In 0.9.7.1, it outputs correctly as a single digit on each line. 请注意,它在1.0.pre中的每一行输出到“1,2,3”。在0.9.7.1中,它在每一行上正确输出为一位数。

Am I doing something wrong here or is this a bug? 我在这里做错了还是这个错误? What is the best way to work-around this issue? 解决这个问题的最佳方法是什么? Thanks! 谢谢!

In 1.0.pre the view's context has changed. 在1.0.pre中,视图的上下文已更改。 When you access {{content}} you are really accessing {{controller.content}} , which is [1,2,3] . 当您访问{{content}}您实际上正在访问{{controller.content}} ,即[1,2,3] You need to access the view's content, which in the individual number, that is done with {{view.content}} . 您需要访问使用{{view.content}}完成的个人号码中的视图内容。

See http://jsfiddle.net/CbwCN/2/ http://jsfiddle.net/CbwCN/2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM