~/talk

Custom form validation with Angular

Talkat NG Bolivia 2019 · on Saturday, 2019-08-24· [angular]
slides:none on file

Shows how to validate Angular forms with a reusable custom validator function for reactive forms and a matching validator directive implementing Validator for template-driven forms. Builds a credit-card checker that first tests three prefixes (AmEx/Visa/MasterCard) and then enforces 16 digits, returns keyed error objects, and plugs into FormBuilder or ngModel. Demonstrates live error rendering using ngIf and Angular’s ng-valid/ng-invalid CSS classes, provides StackBlitz and blog links, and the examples run in the demo.

AI-written summary · about

  1. 0:00Intro
  2. 1:00Form properties
  3. 2:23CSS classes
  4. 5:02From directive
  5. 8:39Custom validation
  6. 10:53Demo
  7. 16:36Testing
  8. 18:25Summary
  9. 20:14Outro
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.