DEV Community

Discussion on: Why can't Form Validation be nice?

Collapse
 
ronaldhove profile image
Ronald Hove

Thanks for the feedback , you have some great points I appreciate the time you took going into detail with each one.

This is a new project I made while working on a very simple app so I will have to make the form builder more configurable to meet other people's needs

To address some of your points

1) It actually does work like that , when you pass in css classes it uses those instead , When explaining how it works , I was leaning more towards explaining the usage example , I will change the the docs to be more clear on that

2) Probably another case of better docs , the form builder uses mostly ion-components , so DOM structure should be customisable a very decent amount.

3) When your FormFeild object array contains the controllers password and confirm_password then the form builder knows its a case of password validation

4) type is the input type i.e

        <input type="text">

title is for the label , and formControlName is used by angular formbuilder when building the actual form , these could be very different

8) If you read the the scenario description , I make the assumption that there is a service api that implements a login function that returns a promise, doLogin just calls that function and when it fails the catch block handles that error. This is for the purpose of describing a use case for setting individual field errors