Adding Custom Validation to the Custom Form Control in Angular

Luka Onikadze
3 min readMay 8, 2020

whenever we want to have some custom validator in Template-driven forms, we have to create an Angular directive and add that directive to input.

So if I have some input and the user must enter his credit card number, I could create a custom Validator, which will check if user entered exactly 16 letters.

--

--