Skip to content

Instantly share code, notes, and snippets.

@mergeweb
Last active September 10, 2015 13:20
Show Gist options
  • Save mergeweb/31262b30e8f5d3b7ddfd to your computer and use it in GitHub Desktop.
Save mergeweb/31262b30e8f5d3b7ddfd to your computer and use it in GitHub Desktop.
this.beforeSave()
.then(this.send.bind(this))
.then(this.success.bind(this))
.then(this.afterSave.bind(this))
// Error validation shown in page
.catch(function(error){
// HERE IS WHERE I WANT THE DEFAULT HTML5 ERRORS TO SHOW
// This will be called if any of the above promises throw an error
})
.then(this.enable_save.bind(this))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment