Files
main.tsmain
What you'll learn
- Retrieve a provider chosen at runtime with ModuleRef.get(), and know why get() refuses scoped providers
- Resolve a transient provider per call with resolve(), and share a sub-tree between calls with a context id
- Look a provider up across module boundaries with { strict: false }, and instantiate an unregistered class with create()
Press Run tests to start the app. Its log appears here.Graded endpoints
Two cats to export
The older one
The plain route still works next to the ones that use ModuleRef
get() fetched the CsvFormatter the container built; resolve() issued ticket 1
A different class this time, and a new ticket, because Ticket is transient and resolve() makes a new one per call
Report is registered nowhere; create() built it and injected CatsService into it
CatsModule does not export CatsService, and strict: false found it anyway