Ember:使用this.get('controller.').content,find方法

Ember: Using this.get('controller.').content, find methods

本文关键字:content find 方法 controller get 使用 Ember this      更新时间:2024-06-08

我正在使用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')