Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Last active January 27, 2016 17:58
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/ea448481c5c6ec2317fc to your computer and use it in GitHub Desktop.
Save kjohnson/ea448481c5c6ec2317fc to your computer and use it in GitHub Desktop.
var myCustomFieldController = Marionette.Object.extend({
initialize: function() {
// On the Form Submission's field validaiton...
var submitChannel = Backbone.Radio.channel( 'submit' );
this.listenTo( submitChannel, 'validate:field', this.validate );
// on the Field's model value change...
var fieldsChannel = Backbone.Radio.channel( 'fields' );
this.listenTo( fieldsChannel, 'change:modelValue', this.validate );
},
validate: function( model ) {
// Custom Validation Here...
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment