How come the computed property student.successfulEvaluations does not update unless the page is refreshed?
App.Student = DS.Model.extend({
username: DS.attr('string'),
evaluations: DS.hasMany('evaluation'),
successfulEvaluations: Ember.computed.filter('evaluations.@each.grade', function(evaluation, index, array){
return evaluation.get('grade') >= 10;
})
});
App.Evaluation = DS.Model.extend({
subject: DS.attr('string'),
grade: DS.attr('number'),
student: DS.belongsTo('student')
});
Ember : 2.2.0
Ember Data : 2.2.1
Aucun commentaire:
Enregistrer un commentaire