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



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

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

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

我找到了一个包含一堆对象的数组,我正在尝试查看内容中的某个方法是否允许我进行查找。这些对象有一个属性"id",我想在类似的东西上找到它

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

这可能吗?

您没有说明要在哪里进行此操作(控制器、路由),但如果它确实是一个数组,则应该能够做到这一点:

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

最新更新