Good day everyone.
I know that I can use @this
to access itemController
’s property, e.g.:
foos: Em.computed.mapBy('@this', 'foo')
How can I access itemController
’s property in the next example?
foos: function() {}.property('@this.foo') // doesn't work
foos: function() {}.property('@this.@each.foo') // doesn't work too
Thanks.
atsjj
2
Assuming you’re working with an Array Controller, change the last line of your example code from:
foos: function() {}.property('@this.@each.foo')
to:
foos: function() {}.property('content.@each.foo')
You would be enumerating over the array controllers model’s here which he doesn’t want to do, he/she wants to enumerate over the item controllers.
foos: function() {}.property('@each.foo')
Example: Ember Latest - JSFiddle - Code Playground
Cool, thanks.
I’ve tried @each.foo
on Ember 1.5
, but it didn’t work, that’s why I’ve created this topic.
atsjj
5
Ah, good catch; totally missed that.