~/talk

Use decorator to beat ngOnChanges – Decoupling ngOnChanges

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

Claim: replace bulky ngOnChanges with a TypeScript property decorator that uses Object.defineProperty under the hood to add per-property getters/setters, compare old and new values, and call a typed callback with a SimpleChange generic. Implementation uses symbol-backed instance keys, optional equality check, and generics for correct types. Author ships it as an npm package, it works for @Input and regular or dynamic properties, and it eliminates the single ngOnChanges block while preserving previous/current values.

AI-written summary · about

  1. 0:00Intro
  2. 0:50ngOnChanges
  3. 7:12Getter and Setter
  4. 8:55Content decorator
  5. 15:55Additional notes
~/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.