📚 Read the book 👉 https://go.asim.dev/angular-book
🔥 Level up your JavaScript 👉 https://go.asim.dev/advjs
🌿 If you find my videos useful please consider planting a tree for me 👉 https://go.asim.dev/trees
🎥 Watch the full playlist 👉 https://go.asim.dev/angular-playlist
The best place to view the code associated with this course is in the online book (https://go.asim.dev/angular-book) via the book if a lecture has code associated with it, it then also has a link to a stackblitz instance so you can run and edit the code sample online.
A validator in Angular is a function which returns null if a control is valid or an error object if it’s invalid.
For model-driven forms, we create custom validation functions and pass them into the FormControl constructor.
For template driven forms we need to create validator directives and provide the validator function to the directive via DI.
Through careful planning, we can share the same validation code between the model driven and template driven forms.
The validator we created in this lecture hardcodes the domain, in the next lecture we will look at how we can make our validators configurable with different domains.
Watch video EP 14.1 - Angular / Advanced Topics / Custom Form Validators online without registration, duration hours minute second in high quality. This video was added by user jawache 26 December 2018, don't forget to share it with your friends and acquaintances, it has been viewed on our site 24,46 once and liked it 5 people.