The primitive used for the instantiation of the individual dependencies in our Angular applications via the DI mechanism of the framework is called injector. The injector contains a set of providers that encapsulate the logic for the instantiation of registered dependencies associated with tokens. We can think of tokens as identifiers of the different providers registered within the injector.
In Angular, we can declare the providers for the individual dependencies using @NgModule. Internally, Angular will create an injector based on the providers we've declared in a module.
Let's take a look at the following snippet, which is located at ch6/injector-basics/basics/app.ts:
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import {
NgModule,
Component,
Inject,
InjectionToken,
Injectable
} from '@angular/core...