19
: 나는 올바른 코드가 각에 있어야하는지 알고 싶습니다 올바른 정리 코드
WZ.ExercisesNewRoute = Em.Route.extend
model: ->
WZ.Exercise.createRecord()
deactivate: ->
@_super.apply this, arguments
@get('currentModel.transaction').rollback()
WZ.ExercisesEditRoute = Em.Route.extend
model: (params) ->
WZ.Exercise.find(params.exercise_id)
serialize: (params, options) ->
exercise_id: params.get('id')
deactivate: ->
@_super.apply this, arguments
tx = @get('currentModel.transaction')
tx.rollback() if tx
비활성화 그렇게 가게는 사용자의 경우 정확한 상태에 저장하지 않거나 저장하지 않습니다.
현재 경우 저장하지 않고 새로운 경로로 직접 나서의 편집 행 노선과, 나는 다음과 같은 오류가 발생합니다 :
Uncaught Error: Attempted to handle event
willSetProperty
on while in state rootState.deleted.saved. Called with {reference: [object Object], store: , name: name}
경로를 빠져 나가는 것을 의미합니까? 다음과 같은 것을 찾고 있습니까? http://stackoverflow.com/questions/14797338/ember-clear-form-after-submitting –
편집 경로에서 새 경로로 직접 전환 한 다음 변경하려고 할 때 오류가 발생합니다 모델. – dagda1
이 질문은 오래된 질문입니다. 그러나이를 수행 할 표준 방법을 알아 냈습니까? –