~/talk

Angular Dependency Injection In-Depth

Talkat Developers Summit 2021 · 2021-02-18..02-19· [angular]
slides:none on file

Covers how Angular resolves tokens through two injector types — component/element injectors and the R3 module injector — and why a null injector error appears when nothing is provided. Demonstrates a CounterService example to show lazy instantiation, multiple instances when provided at component nodes, and shared singletons when using providedIn: "root" or providedIn: "platform". Explains provider forms (useClass, useValue, useFactory, useExisting), decorators like skipSelf and optional, and creating typed InjectionToken constants.

AI-written summary · about

  1. 0:00Introduction to DI
  2. 2:30Injector hierarchy explained
  3. 8:12Registering dependencies
  4. 17:49Lazy instantiation of services
  5. 22:13Node injector vs module injector
  6. 30:07Controlling instance scope
  7. 38:43Root level injector
  8. 40:10Optional decorator usage
  9. 44:30Multiple module bootstrapping
  10. 50:41Injection tokens for constants
  11. 57:07Summary and resources
~/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.