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