~/talk

Simplifying DI and Services in Angular

Talkat AngularNL 2020 · on Friday, 2020-07-24· [angular]
slides:none on file

Live demo uses Angular 9, a CLI-generated log service with a static counter and an InjectionToken plus useValue configs to show exactly how many instances Angular creates and when code is bundled. Default providedIn: 'root' services are singleton and tree‑shakable; putting a service in the providers array forces inclusion and can create extra instances. Using providedIn: 'any' yields separate instances per lazy module so different endpoint/token values work; the demo builds, lazy loads modules, and shows three instances created when expected.

AI-written summary · about

  1. 0:00Introduction to DI
  2. 1:03DI core concepts
  3. 3:56Creating a service
  4. 5:57Singleton vs tree-shakable
  5. 13:03Provider configuration
  6. 14:43Services in lazy loading
  7. 20:16Passing dynamic data
  8. 25:29Managing module data
  9. 29:41Service isolation strategies
  10. 35:16The power of 'any'
~/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.