5
我環顧四周,但我找不到任何良好的文檔的實際區別如下之間是什麼:EmberJS中的[],@each,content和<arrayName>有什麼區別?
Ember.Object.extend({
// ...
myProperty1: function() { /* ... */ }.property('myArray'),
myProperty2: function() { /* ... */ }.property('myArray.content'),
myProperty3: function() { /* ... */ }.property('myArray.[]'),
myProperty4: function() { /* ... */ }.property('[email protected]')
});
我也明白,.content
似乎是數組的屬性內部存儲,這可能無法使用,如果這恰好是PromiseArray
。我也明白,@each
不會以這種方式使用,但主要是爲了訪問ProxyArray
,由於映射此數組中每個元素的內部屬性而生成結果。
除了這些微妙的差異,他們似乎工作幾乎相同。但是myArray
和myArray.[]
呢?他們和其他人相比如何呢?
令人印象深刻的答案。直截了當,明確。非常感謝你。 – Alpha 2014-10-21 00:54:03