[英]Ember store refresh issue! Error: could not respond to event didChangeData in state rootState.loaded.updated.uncommitted
[英]Uncaught Error: Attempted to handle event `loadedData` while in state rootState.loaded.updated.uncommitted
我正在使用ember-data从REST API获取数据并创建了一个模型App.Category。 在'index'状态下,我以这种方式获取数据:
App.Category.find({type: 1});
这很好。 但是,每当我转换到新状态并调用时:
App.Category.find({type: 2});
但是,我收到此错误:
Uncaught Error: Attempted to handle event `loadedData` on <App.Category:ember424:1> while in state rootState.loaded.updated.uncommitted. Called with {}
我该如何解决?
我最近遇到了这个问题,根本原因是我做了一些愚蠢的事情,就像没有呈现更新模型的JSON表示。
这是我在更新时从rails控制器渲染的示例:
format.json { head status: :ok }
以下是我修复它的方法:
format.json { render json: @thing, status: :ok }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.