Last active
August 23, 2018 12:50
-
-
Save feanor07/0491b07812bad689115bab9c786126f8 to your computer and use it in GitHub Desktop.
Stackoverflow Question #42921997
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'; | |
export default Ember.Component.extend({ | |
actions: { | |
update(value) { | |
this.get('onupdate')(value); | |
this.get('onvalidate')(); | |
} | |
} | |
}); |
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 UserValidations from '../user-validation'; | |
export default Ember.Controller.extend({ | |
UserValidations, | |
genders: [{ | |
key: 'm', | |
label: 'Male' | |
}, { | |
key: 'f', | |
label: 'Female' | |
}], | |
countries: ["","England","France","Italy","Spain","Turkey","USA"], | |
model:{}, | |
actions: { | |
submit() { | |
} | |
} | |
}); |
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.12.1", | |
"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.12.0", | |
"ember-template-compiler": "2.12.0", | |
"ember-testing": "2.12.0" | |
}, | |
"addons": { | |
"ember-cli-maskedinput": "0.1.2", | |
"ember-validated-form": "0.1.10" | |
} | |
} |
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 { | |
validatePresence, | |
validateLength | |
} from 'ember-changeset-validations/validators'; | |
export default { | |
firstName: [ | |
validatePresence(true), | |
validateLength({min: 3, max: 40}) | |
], | |
lastName: [ | |
validatePresence(true), | |
validateLength({min: 3, max: 40}) | |
], | |
aboutMe: [ validateLength({allowBlank: true, max: 200}) ], | |
country: [ validatePresence(true) ], | |
gender: [ validatePresence(true) ], | |
creditCard: [validatePresence(true), | |
validateLength({is:16})] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment