~/talk

Typing the not so secret to customisation ngTemplateOutlet

Talkat ng-conf 2023 · 2023-06-14..06-15· [angular, typescript]
slides:none on file

Shows how to get real typing for ngTemplateOutlets by replacing label markers with a directive to tag templates plus an ngTemplate context guard that asserts the template’s context interface. Demonstrates making the directive generic, adding an input so Angular infers the generic from usage, and how Angular 16 tightens context checking. Uses a concrete sharks example and points to a repo with runnable code and comparison of structural and attribute syntaxes.

AI-written summary · about

  1. 0:00Introduction
  2. 1:24What is ngTemplateOutlet
  3. 4:15Typing problem
  4. 5:19Introducing ngTemplateContextGuard
  5. 7:28Using ngTemplateContextGuard
  6. 8:09Generic types with ngTemplateOutlet
  7. 10:58Alternative syntax
  8. 11:41Angular 16 context typing
~/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.