Skip to content

Instantly share code, notes, and snippets.

@danmcclain
Created May 6, 2015 13:07
Show Gist options
  • Save danmcclain/78b5182de8493b21b462 to your computer and use it in GitHub Desktop.
Save danmcclain/78b5182de8493b21b462 to your computer and use it in GitHub Desktop.
Ember Validations: Controller/Component
import Ember from 'ember';
import EmberValidations from 'ember-validations';
const { Controller, computed } = Ember;
const { alias } = computed;
export default Controller.extend(EmberValidations, {
contact: alias('model'),
validations: {
'contact.email': {
presence: true
},
'contact.name': {
presence: true
},
'contact.reason': {
presence: true
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment