Question: What is the difference, if any, of the resulting code logic based on these two provider configurations?

  1. They are the same. Both will result in a new instance of Logger that is bound to the FormattedLogger token.
  2. The useClass syntax tells the injector to make a new instance of Logger and bind that instance to the FormattedLogger token. The useExisting syntax refers to an already existing object instance declared as Logger.
  3. Both of them are wrong. A strong type connot be used for useClass or useExisting.
  4. They are the same. Both will result in the FormattedLogger token being an alias for the instance of Logger.

Answer: The correct answer of the above question is Option B:The useClass syntax tells the injector to make a new instance of Logger and bind that instance to the FormattedLogger token. The useExisting syntax refers to an already existing object instance declared as Logger.