Forked from offirgolan/controllers.application.js
Last active
November 20, 2017 23:58
-
-
Save stephanebruckert/b16c0637affadf263b7f766b0541dffa to your computer and use it in GitHub Desktop.
New Twiddle
This file contains 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 Ember from 'ember'; | |
import { buildValidations, validator } from 'ember-cp-validations'; | |
const Validations = buildValidations({ | |
email: { | |
type: 'email', | |
validators: [ | |
validator('format'), | |
validator('uniqueness') | |
] | |
} | |
}); | |
export default Ember.Controller.extend(Validations, { | |
appName: 'Ember Twiddle' | |
}); |
This file contains 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
{ | |
"version": "0.10.7", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.10.0", | |
"ember-data": "2.10.0", | |
"ember-template-compiler": "2.10.0", | |
"ember-testing": "2.10.0" | |
}, | |
"addons": { | |
"ember-cp-validations": "3.1.5" | |
} | |
} |
This file contains 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 BaseValidator from 'ember-cp-validations/validators/base'; | |
export default BaseValidator.extend({ | |
validate(value, options) { | |
console.log(value + ' should have been an email?'); | |
return ' and open the console'; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment