Provider Tokens — Fundamentals · NestJS

Separate a provider's token from its recipe: inject a value under a symbol token, bind an abstract class to its implementation, and export a token to another module.

What you will learn

Read the theory for Provider Tokens

All Fundamentals lessons

All NestJS courses

loading types…

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