Skip to content

Instantly share code, notes, and snippets.

@Unnumbered
Created March 30, 2017 13:53
Show Gist options
  • Save Unnumbered/ef7d76f1617bec023fae072ba671b6cb to your computer and use it in GitHub Desktop.
Save Unnumbered/ef7d76f1617bec023fae072ba671b6cb to your computer and use it in GitHub Desktop.
nested errors workaround
_embeddedErrorsHandling: Ember.observer 'item.errors.[]', ->
@get('item.errors.content').forEach (error) =>
if error.attribute.indexOf('target_bid.') == 0
attribute = Ember.String.camelize(error.attribute.replace('target_bid.', ''))
@get('item.targetBid.errors').add(attribute, error.message)
@set('item.targetBid.isError', true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment