8
私はこのようなものを持っている:計算されたフィルタリングされたプロパティを作成するにはどうすればよいですか?
Epic = Ember.Object.extend({
children:[],
children_filtered: function(){
return this.get("children").filterProperty("archived",false);
}.property("children"),
init: function() {
this._super();
this.set("children", Ember.ArrayController.create({content:[]}));
this.set("stories", Ember.ArrayController.create({content:[]}));
},
});
注children_filtered計算されたプロパティ。
私はビューにchildren_filtered使用する場合
は...{{#each content.children_filtered }}
hi
{{/each}}
私のアプリケーションは、私が間違ってやっている100%
任意のアイデア@ CPUとハングアップ?アイテムのリストとフィルタリングされたアイテムのリストを持つオブジェクトのフォローアップには、より良いパターンがありますか?
ありがとう!あなたは揺れる。 –
cacheableをデフォルトにする方法についてのGithubの議論は、ここにあります:https://github.com/emberjs/ember.js/issues/38 –
そしてこれがデフォルトです:http://emberjs.com/api/classes/Ember .ComputedProperty.html#method_cacheable –