Files
main.tsmain
What you'll learn
- Read the long form of a provider, { provide, useClass }, and explain what the shorthand hides
- Provide a value under a symbol token and inject it with @Inject()
- Use an abstract class as the token for an implementation, and export a token to another module
Press Run tests to start the app. Its log appears here.Graded endpoints
The service has its logger and its config, so the app boots and a cat is stored
Second of three
Third of three
The value provided under CATS_CONFIG says three, and the service read it
Three cats
LogsController asked for Logger and received the same MemoryLogger the service wrote to, because the token is exported