Injector
object. Angular simplifies DI even further. With Angular, programmers almost never have to get bogged down with injection details.@NgModule
. Specifically the providers
and declarations
array. (declarations
is where we put components, pipes and directives; providers
is where we put services)AppModule
is told about the ChatWidget
class. Another way of saying this is that Angular has been provided a ChatWidget
.ChatWidget
. What if ChatWidget
was a string, or a plain function?AuthService
, AuthWidget
and ChatSocket
? How is ChatWidget
getting those?ChatWidget
is being told about its dependencies. Perhaps that is related to those odd @Injectable
statements.