Last active
January 10, 2018 01:13
-
-
Save andrewheartsxd/352b124a50f15487461aab6b557b0dcf to your computer and use it in GitHub Desktop.
ember-bootstrap block form form.element validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import DS from 'ember-data'; | |
| import {validator, buildValidations} from 'ember-cp-validations'; | |
| const Validations = buildValidations({ | |
| email: [ | |
| validator('presence', true), | |
| validator('format', {type: 'email'}) | |
| ], | |
| message: [ | |
| validator('presence', true), | |
| validator('length', { | |
| min: 5 | |
| }) | |
| ] | |
| }); | |
| export default DS.Model.extend(Validations, { | |
| email: DS.attr('string'), | |
| message: DS.attr('string') | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment