📚 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.
Смотрите видео EP 14.1 - Angular / Advanced Topics / Custom Form Validators онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь jawache 26 Декабрь 2018, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 24,46 раз и оно понравилось 5 людям.