>

CODEMASTERYLAB

IDE PLATFORM
CoursesCommunity BlogsKnowledge GraphQuizzesInterview Prep

Sign in to track progress & earn XP

Sign In Create Account
>
Code Mastery Lab

Code Mastery Lab

Sign In

DI Patterns — Factories, Tokens, and Swapping Implementations

Question 1 / 1

0:00
Core
Medium

You need to inject the current user's auth token into a service. The token is stored in localStorage and may change during the app session. Which provider configuration correctly delivers the current token value each time a new service instance is created?

typescript export const AUTH_TOKEN = new InjectionToken<string>('AUTH_TOKEN');