Ember.js 如何查找Ember的()和filter()模型。选择内容
我有一个模型,它是多对多相关的(依赖对象)。我想使用Ember.js 如何查找Ember的()和filter()模型。选择内容,ember.js,Ember.js,我有一个模型,它是多对多相关的(依赖对象)。我想使用Ember。选择设置对象之间的关系。但并非所有对象都可以关联,因此我需要对它们进行两次过滤: 有一定的档案价值 id!==当前对象的id 以下是模板: {{view Em.Select contentBinding="others" multiple="true" }} 下面是JS咖啡脚本代码: App.Monster = DS.Model.extend location: DS.belongsTo
Ember。选择设置对象之间的关系。但并非所有对象都可以关联,因此我需要对它们进行两次过滤:
- 有一定的档案价值
- id!==当前对象的id
以下是模板:
{{view Em.Select
contentBinding="others"
multiple="true" }}
下面是JS咖啡脚本代码:
App.Monster = DS.Model.extend
location: DS.belongsTo('App.Location')
requirements: DS.hasMany('App.Monster')
App.LessonEditController = Em.ObjectController.extend
...
others: (->
_this = this
App.Monster.find(location: this.get('model').get('location').get('id')).rejectProperty('id', this.get('model').get('id'))
).property()
问题是find()
看起来像是懒惰之类的。它只在我删除rejectProperty时起作用,所以它只是一个筛选。如何做到两者