~/talk

The Control Value Accessor

Talkat ng-conf 2019 · 2019-05-01..05-03· [angular]
slides:none on file

Shows how implementing the ControlValueAccessor interface lets custom inputs plug directly into Reactive Forms so the form calls writeValue, registerOnChange, registerOnTouched, setDisabledState and UI updates follow. Builds a sample app: a type‑ahead that emits an ID and a star rating disabled until selection using a third‑party typeahead, with tests via a host component that assert patchValue initializes UI, clicks update form value, blur sets touched, and disable prevents interaction — it works as described.

AI-written summary · about

  1. 0:00Intro
  2. 0:12What is a wormhole
  3. 0:36Problems with wormholes
  4. 0:53Control Value Accessor
  5. 2:54Reactive Forms
  6. 5:18Pitfalls
  7. 5:46Control Value Access
  8. 7:12Register on Change
  9. 8:16Blur
  10. 8:50DisabledState
  11. 9:14Diagram
  12. 9:30Implementation
  13. 11:20Typeahead
  14. 11:41Data Structure
  15. 11:54Markup
  16. 12:42Implement
  17. 14:15Rating
  18. 14:29WriteValue
  19. 15:12Disable
  20. 15:35Rating UI
  21. 16:00Testing
  22. 19:04Key Concepts
  23. 19:29Slides
~/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.