Skip to main content

Function: getTokenName()

getTokenName(token): string

Returns a human-readable identifier for a DI token.

  • If the token is a class constructor, returns its name.
  • Otherwise, returns String(token).

Parameters

token

unknown

The injection token (constructor, string, symbol, or provider).

Returns

string

A simple string name for use in logs or error messages.