Super Simple Reactive Forms Validation On Submit — Angular 8+

Adrian Narloch
Oct 22, 2019

--

With Angular’s eighth version release, the new FormGroup method markAllAsTouched() enables dynamic highlighting of all required fields upon clicking submit. 🙌

profile.component.html
profile.component.ts

All invalid inputs will get .ng-invalid .ng-touched class which you can target directtly in your css. It saves a lot of time spent on doing custom solutions. 🙂

Thanks for reading!
If you have any suggestions, feel free to contact me.
Looking for an experienced developer? Visit
narloch.eu.

--

--

Adrian Narloch
Adrian Narloch

Written by Adrian Narloch

Digital Product Developer & Designer

Responses (1)