![](/img/trans.png)
[英]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.