nodejs-model
nodejs-model copied to clipboard
Need help with .validate()
Need help with this validator function..
//Invoke validations and wait for the validations to fulfill
u1.validate(function() {
if u1.isValid {
//validated, perform business logic
} else {
//validation failed, dump validation errors to the console
console.log(p1.errors)
}
});
A few things.
- Some errors in this example. It should look like..
//Invoke validations and wait for the validations to fulfill
u1.validate(function() {
if ( u1.isValid ) {
//validated, perform business logic
} else {
//validation failed, dump validation errors to the console
console.log(u1.errors)
}
});
".validate" takes an argument as "filter" but does nothing with it nor invokes it as the example above illustrates.
The function does this with it..
if (filter) {
vProps = [filter];
}
Am I missing something?
Best, Steve