Ember:使用this.get('controller。')。content,查找方法

时间:2013-12-09 17:15:53

标签: javascript ember.js

我正在使用this.get('controller.raceModal')。内容,我试图实现的是这个;

如果我深入研究以下表达式

this.get('controller.raceModal').content.content

我找到一个包含大量对象的数组,我试图看看内容中的一个方法是否允许我进行查找。这些对象有一个属性'id',我希望在以下内容中找到它:

this.get('controller.raceModal').content.find({'id', '15'})

这可能吗?

1 个答案:

答案 0 :(得分:0)

你没有说你想要做到这一点(控制器,路线),但如果它确实是一个数组你应该能够做到这一点:

this.get('controller.raceModal').findBy('id', '15')