LoginSignup
1
1

More than 5 years have passed since last update.

Ember.js 1.13 以降の @each と [] の意味の違いについて

Posted at

Ember.jsで依存するキー指定を行う際に使う、 @each[] は 1.13 以降は違う意味になります。

@each

配列内の各プロパティの変更があった場合に再計算されます。

hoge: function() {
  // posts 配列中の各titleに変更があれば実行
}.property('posts.@each.title');

[]

配列自体の変更、すなわち、追加や削除の場合に再計算されます。

fuga: function() {
  // posts 配列への追加や削除があれば実行
}.property('posts.[]');

おわり

Ember.jsのバージョンを上げるときに勘違いで @each を全部 [] に書き換えてしまってあちこち動かなくしてしまったので、忘れないように記事をしたためました…

以下に書いてあることをよく読めばこんなことには…

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1