zestia / ember-validation Goto Github PK
View Code? Open in Web Editor NEWSimple validation utils for Ember apps
License: MIT License
Simple validation utils for Ember apps
License: MIT License
Hello and thank you so much for your work on this add-on!
I have a newbie question: perhaps this is already possible, but I'm not understanding that it is. I want to be able to validate records for a model's hasMany association
Given:
const meal = { name: 'lunch', courses: [ { name: 'pizza' }, { name: 'tater-tots' } ] };
I see syntactic examples for :
const constraints = {
name() {
return [present()];
},
'courses.0.name'() {
return [present()];
},
};
But I can't find an existing syntax for that supports:
const constraints = {
name() {
return [present()];
},
courses() {
return {
name() {
return [present()];
},
};
},
};
...where I want to validate properties on some unknown number of hasMany records. Is this an existing feature? Also, how would you go about validating the size
of the hasMany collection.
Zestia, thank you for your work!
I'm digging through the code and trying to write an async constraint ... like to verify uniqueness on an email field ... do you have any examples of how this is supposed to work? It seems like at the core of your project you consider async validations so I'm expecting this to work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.