Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Last active January 27, 2016 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjohnson/49fe1187bd9ad823f275 to your computer and use it in GitHub Desktop.
Save kjohnson/49fe1187bd9ad823f275 to your computer and use it in GitHub Desktop.
var myCustomFieldController = Marionette.Object.extend( {
initialize: function() {
// ...
},
validate: function( model ) {
// ...
// Do Validation Here...
// ...
// If validation passes...
var modelID = model.get( 'id' );
var errorID = 'custom-field-error';
var fieldsChannel = Backbone.Radio.channel( 'fields' );
// Add Error
fieldsChannel.request( 'remove:error', modelID, errorID );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment