You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With these changes, we can now refuse to add an item unless it passes validation. We could also display error messages if validation fails by binding the invalid event in modelEvents. You can see how we've set our fields to blank fields on the model and also in the ui hash. If we start having more and more fields, you can see how this would quickly become unmanageable. Surely we can just clear the form when the model is cleared?
Validation Result Is Ignored
You provided the validation function in model, but in driver.js, you still add the model anyway, regardless of the validation outcome. I think you should wrap the last 2 lines inside onAddTodoItem() inside an if statement, such as if (this.model.validationError === null)
Validation Result Is Ignored
You provided the validation function in model, but in
driver.js
, you still add the model anyway, regardless of the validation outcome. I think you should wrap the last 2 lines insideonAddTodoItem()
inside an if statement, such asif (this.model.validationError === null)
Submitted by @charliegdev
The text was updated successfully, but these errors were encountered: