Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 ember,我需要更新特定模型的所有数据。reload 方法不起作用,因为它必须是单独的模型。我浏览了文档,但在任何地方都找不到可以再次调用“索引”api 路由并获取所有数据列表的地方。有谁知道这样做的方法?
您可以使用该invoke方法重新加载,或对集合中的每个项目调用任何方法:
invoke
collection.invoke('reload')
你可以简单地做
App.Model.find()
这将从服务器加载所有模型或
collection.forEach(function(model){ model.reload(); }
这只会重新加载您的收藏。