App.Exam = DS.Model.extend({
examType: attr('string'),
examDate: attr('date'),
gradeText: attr('string'),
courseName: attr('string'),
courseName__startswith: attr('string'),
typeName: attr('string'),
numberOf: attr('number'),
grade: attr('number'), });
这是我想从控制器访问的模型。我用这个过滤模型
App.ExamController = Ember.Controller.extend({
// the initial value of the `search` property
search: ''
,query: function() {
// the current value of the text field
var queryCourseName = this.get('searchCourseName');
this.set('searchResult',App.Exam.find({courseName: queryCourseName})
}
});
这是存储结果的正确方法App.Exam.find()
吗?如果是我如何searchResult
从另一个控制器访问该属性并遍历这些值?