简体   繁体   中英

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.

It seems that CollectionView no longer passes each element of the collection to its template view class?

I've distilled my issue to this 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.

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. When you access {{content}} you are really accessing {{controller.content}} , which is [1,2,3] . You need to access the view's content, which in the individual number, that is done with {{view.content}} .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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