3
我使用燼數據與0.13的軌道。我有一個basicinfo控制器來處理basicinfo模型更新。更新操作是:燼數據處理服務器錯誤
update: ->
@content.save()
@content.on('becameInvalid', (response) ->
alert Em.inspect(response.errors)
)
basicinfo.hbs:
<aside class='basicinfo-aside'>
{{#if inEditModel}}
<div class='control-group'>
<label for='basicinfo_about_me'>{{t '.basicinfo.edit.about_me'}}</label>
<div class='controls'>
{{view Em.TextArea id='basicinfo_about_me'
class='basicinfo-about-me'
name='basicinfo[about_me]'
valueBinding='aboutMe'}}
</div>
</div>
<div class='action-group'>
<span {{bindAttr class=':about-me-length-remain
hasAboutMeLengthRemain:muted:text-error'}}>
{{aboutMeLengthRemain}}
</span>
<button class='btn-cancel btn' {{action cancel}}>
{{t '.basicinfo.edit.cancel'}}
</button>
<button class='btn-update btn btn-primary' {{action update}}>
{{t '.basicinfo.edit.update'}}
</button>
</div>
{{/if}}
</aside>
<div class='basicinfo-inner'>
{{#unless inEditModel}}
<h5>
{{t '.basicinfo.about_me'}}
{{#if canManage}}
<a class='lnk-edit' href='#' {{action edit}}>
<i class='icon-edit'></i>
</a>
{{/if}}
</h5>
<p class='about-me'>{{aboutMe}}</p>
{{/unless}}
</div>
當我點擊無效數據更新按鈕第一次錯誤顯示正確,但如果我不修復錯誤,按更新按鈕再次灰燼節目:「未捕獲的錯誤:試圖在同時處理事件willCommit
狀態rootState.loaded.updated.invalid未定義調用。」如何解決呢謝謝!