Angular 2 (Angular 4) – Form Validation



Angular 2 (Angular 4) – Form Validation

In this video we take a look at angular 2 validation for the first time. We look at how Angular 2 bootstraps specific css classes to each control that based on user interaction changes. These classes are ng-untouched, ng-touched, ng-dirty, ng-pristine, ng-valid, ng-invalid.

We also look into how we can access the form control properties within the markup to determine the state of a control in real time and toggling Bootstrap css classes based on the state of the control as well. All validation in this video is based on the required attribute in HTML5.

To follow along with this tutorial please clone down the following branch, then checkout the tutorial11 branch. If you wish to see the final result, check out the tutorial12 branch.

https://github.com/lyraddigital/angular2tutorial.git

You can follow me on twitter at: https://twitter.com/dduckmanton82
You can also follow my business account at: https://twitter.com/LyradDigital
You can also follow my business account on Facebook at: https://www.facebook.com/lyraddigital

I publish an article every now and then on LinkedIn as well. So connect with me on LinkedIn at: https://au.linkedin.com/in/daryl-duckmanton-4478a14a

Watch all my other videos in this series:-

Part 1 – Introduction and the CLI: https://www.youtube.com/watch?v=QzXdiH3wJp0
Part 2 – Angular Module Basics: https://www.youtube.com/watch?v=GeomqoUUCho
Part 3 – Multiple Angular Modules: https://www.youtube.com/watch?v=33ADKstmXqQ
Part 4 – Shared Angular Modules: https://www.youtube.com/watch?v=QExtdZKqw1E
Part 5 – Eagerly and Lazily Loading Modules: https://www.youtube.com/watch?v=0YC4qmnkMbU
Part 6 – Basic App Component and Presentation: https://www.youtube.com/watch?v=np7rZUob-CY
Part 7 – App Component bindings: https://www.youtube.com/watch?v=RmC8B_GaONM
Part 8 – Attribute binding and the main navigation: https://www.youtube.com/watch?v=OxjR7lFP430
Part 9 – Basic Form and Dual Binding: https://www.youtube.com/watch?v=23HsTwj7oAw
Part 10 – Registration Form Part 1: https://www.youtube.com/watch?v=ysEYpkQ-wbU
Part 11 – Registration Form Part 2: https://www.youtube.com/watch?v=xUaz3GULoIQ
Part 13 – Registration Form Part 4: https://www.youtube.com/watch?v=8GhobtQCRvo
Part 14- Registration Form Part 5: https://www.youtube.com/watch?v=q7mkQmqL0JM
Part 15 – Structural Directives: https://www.youtube.com/watch?v=Iw1H15Aeg5s
Part 16 – Dynamic Forms: https://www.youtube.com/watch?v=nxa78ZxeNdI

source

You May Also Like