ember-data isValid, isSaving and isError

Viewed 2166

I have a simple ember-data model:

WZ.Exercise = DS.Model.extend
  name: DS.attr 'string'
  description: DS.attr 'string'
  group: DS.belongsTo 'WZ.Group'

I want to display a confirmation message to the user if a new record has been saved or if an error has occurred. The error could be that the the object is invalid and an error json is returned like below:

{"errors":{"description":["can't be blank"]}}

I can see that each model comes with an isSaving, isValid property and an isError property.

Can anybody tell me how I can use these properties to display the correct notifications to the users?

2 Answers
Related