【发布时间】:2023-03-21 02:02:01
【问题描述】:
我想观察一个嵌套属性。我有以下 Ember 数组:
specifications: [
{
title: "specification name",
filters: [
{
title: "example"
checked: false
},
{
title: "example 2",
checked: true
}
]
},
...
]
我想创建一个计算属性:
activeFilters: (->
Ember.computed.filterBy('specifications.@each.filters', 'checked', true),
).property('specifications.@each.filters')
active filters 属性不起作用,我尝试了几种属性方法的组合,但没有一个起作用。
我正在尝试创建的属性真的可行吗?
【问题讨论】:
-
你的意思是
specifications.filters.@each? -
我注意到您从不接受答案。考虑结束您的一些问题。
-
我现在就去做。
标签: ember.js