We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
there's no "false" returned or error in the console unless you put {validate: true} on set func....
like
person.set('age', -1, {validate: true}); Age must be positive false
Grabbed from http://www.codebeerstartups.com/2012/12/4-adding-validations-in-models-in-backbone-js-learning-backbone-js/
var person = new Person; person.get('age')// will return 23 as default value person.set('age', -1)// will return false and value ie -1 will not be set
person.on('error', function(model,error){ console.log(error); // printing the error message on console. });
The text was updated successfully, but these errors were encountered:
Yeah, just to confirm I'm still getting the same as above.
Also in the post like 9 is written if ( attributes.age < ){ instead of if ( attributes.age < 0){
if ( attributes.age < ){
if ( attributes.age < 0){
Though i realise this is an old tut now, not sure if it's still maintained?
Sorry, something went wrong.
No branches or pull requests
there's no "false" returned or error in the console unless you put {validate: true} on set func....
like
person.set('age', -1, {validate: true});
Age must be positive
false
Grabbed from http://www.codebeerstartups.com/2012/12/4-adding-validations-in-models-in-backbone-js-learning-backbone-js/
var person = new Person;
person.get('age')// will return 23 as default value
person.set('age', -1)// will return false and value ie -1 will not be set
person.on('error', function(model,error){
console.log(error); // printing the error message on console.
});
The text was updated successfully, but these errors were encountered: