Question · Angular course · Module 5: Services and DI

providedIn: 'root'

What does 'providedIn: root' mean in the @Injectable decorator?

Answer options

  • The service is available only in the root component
  • The service is a singleton available throughout the entire application
  • The service must be imported in every module
  • The service is created on every use

You can check the correct answer by solving this task in the CodeWorlds game.