Skip to main content

Provider types and tokens

Learn Provider types and tokens (Module 8 · Services and Dependency Injection, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

InjectionToken and value providers • Interfaces and primitives do not exist at runtime, so Angular cannot use them as keys. An InjectionToken is a unique key object you create for them. A value provider ( useValue ) supplies a ready-made value, like a config object or a constant.

More lessons in Module 8 · Services and Dependency Injection