Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What is the purpose of an InjectionToken?

  1. A To authenticate API requests
  2. B To provide a dependency injection key for values that are not classes, such as configuration objects
  3. C To create a new component
  4. D To define route parameters
Answer

To provide a dependency injection key for values that are not classes, such as configuration objects

TypeScript interfaces do not exist at runtime, so they cannot be used as DI tokens. InjectionToken provides a unique runtime key.

All Angular MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as