我有一个/licenses路由的模型钩子,它返回this.store.find('license')。但是,模板仍然显示旧的许可证列表(不是从服务器返回的许可证列表,它包含的许可证比商店中的许可证少)。我想强力更新模型。我如何使用setup控制器钩子来完成它?我在某个地方读到,我们可以在每次加载模板时将模型从setupController钩子设置为强制更新模型。
发布于 2014-03-19 08:28:37
setupController: function(controller, model) {
controller.set('model', this.store.find('license'));
}这就是你要找的。这设置了所需控制器的模型。
https://stackoverflow.com/questions/22496832
复制相似问题