Improving our application forms – Validators
We know how the binding engine of Aurelia works. Also, we know how to intercept and customize that binding behavior. We know too how to transform data between View
-ViewModel
layer according to our needs. Just some things are pending, and the aurelia-validation
plugin is one of them. When you need data provided by the user, you have to expect anything. The user didn't know your app. He will do anything he wants, and you need to be prepared for that. You need to ensure that data provided by the user is, at least, in the right format your back service is expecting. You need to filter just the right values and send alerts to the user telling which values are wrong and how they can fix it. We often need to put ourselves on the user's side. Software development is more than just programming, more than just creating forms and storing/retrieving data. We need to make our application fault-tolerant and as we said earlier, think always in the worst case...