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를 중단? 항목 목록에 필터링 된 항목 목록이있는 개체에 대해 따라야 할 더 좋은 패턴이 있습니까?
감사 :
는 여기 jsFiddle 예입니다! 너 락. –
캐시 가능을 기본값으로 만드는 것에 대한 Github의 토론은 다음과 같습니다. https://github.com/emberjs/ember.js/issues/38 –
이제 기본값 : http://emberjs.com/api/classes/Ember .ComputedProperty.html # method_cacheable –