我想弄清楚我的计算属性如何识别我的关系是否设置。创建一个计算布尔使用关系字段Ember
Project = Model.extend({
participantes: hasMany('author')
...
我需要改变我的CSS基础,如果有一个作者。
{{my-component project=project}}
//---------- my-component.js
export default Ember.Component.extend({
classNameBindings: ['hasParticipante'],
hasParticipante = Ember.computed('project.participantes', function(){
//the code I need gonna here
})});
箭头函数不是普通函数的缩写,他们改变'this'绑定。您无法将箭头函数传递给'Ember.computed'。 – locks
你说得对。我没有复制我的真实代码。 – heat