[英]Ember Uncaught Error: Attempted to handle event `didSetProperty`
I am getting this error and it seems to be when I destroy the session on my "auth" logic. 我收到此错误,似乎是在销毁我的“ auth”逻辑上的会话时。 I have read everything I can find and it seems to be something to do with the values of the object that is being destroyed, but I've tried everything I have found and no luck. 我已经阅读了所有可以找到的东西,这似乎与被破坏对象的值有关,但是我已经尝试了所有发现的东西,但是没有运气。 If anyone could point me in the right direction to a solution I would greatly appreciate it. 如果有人能为我指出正确的解决方案,我将不胜感激。
Uncaught Error: Attempted to handle event didSetProperty
on while in state root.deleted.saved. 未捕获的错误:试图处理事件didSetProperty
上,而在状态root.deleted.saved。 Called with {name: email, oldValue: undefined, originalValue: undefined, value: test@test.com}. 用{name:email,oldValue:undefined,originalValue:undefined,value:test@test.com}进行调用。
App.ApplicationController = Ember.ObjectController.extend
actions:
signOut: ->
@get('model').destroyRecord().then =>
$.removeCookie 'apiKey'
@set 'model', @store.createRecord 'session'
@transitionToRoute 'sign-in'
, ->
@transitionToRoute 'sign-in'
App.ApplicationRoute = Ember.Route.extend
model: ->
if !$.cookie 'apiKey'
@store.createRecord 'session'
else
@store.find('session', 'current').then (session)->
session
App.Session = DS.Model.extend
access_token: DS.attr()
email: DS.attr()
password: DS.attr()
isLoggedIn: Ember.computed.notEmpty 'access_token'
user: DS.belongsTo 'user', embedded: 'always'
App.SessionSerializer = DS.ActiveModelSerializer.extend DS.EmbeddedRecordsMixin,
attrs: user: embedded: 'always'
This is a bit late, sorry. 很晚了,抱歉。
When the promise to destroy the model is resolved, something is being set on the model - session record in this case. 解决销毁模型的承诺后,将在模型上设置某些内容-在这种情况下为会话记录。 Please note the @get('model').destroyRecord()
command is followed by the @set 'model'
command. 请注意, @get('model').destroyRecord()
命令后跟@set 'model'
命令。
That is why the error message has while in state root.deleted.saved
. 这就是为什么错误消息while in state root.deleted.saved
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.