~/talk

Creating Custom Structural Directives

Talkat ngVikings 2019 · 2019-05-27..05-28· [angular, component-design]
github:ashB100
slides:none on file

Builds one concrete structural directive named appDeclareVar and shows working code: uses TemplateRef and ViewContainerRef via dependency injection, creates embedded views with viewContainer.createEmbeddedView(templateRef, context), exposes a typed context object with context.$implicit and additional properties, wires inputs with a setter tied to the directive attribute name, parses the microsyntax, demonstrates change detection with async pipes and an observable, and verifies the directive works in a live demo.

AI-written summary · about

  1. 0:00Understanding directives
  2. 2:46Core building blocks
  3. 5:32TemplateRef and views
  4. 8:59ViewContainerRef explained
  5. 12:21Planning custom directives
  6. 19:48Implementing the directive
~/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.