DI Provider Interfaces (interface/provider.ts)

angular · packages/core/src/di/interface/provider.ts · typescript · MIT
infra, lang:typescript, fw:angular, tag:dependency-injection, tag:providers

Defines Angular dependency injection provider type interfaces (value, class, factory providers) and a helper to check environment providers. Reuse when building DI configuration or custom injector logic.

// Source: https://github.com/angular/angular | License: MIT | Copyright 2010-2026 Google LLC. https://angular.dev/license
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.dev/license
 */

import {Type} from '../../interface/type';

/**
 * Configures the `Injector` to return a value for a token.
 * Base for `ValueProvider` decorator.
 *
 * @publicApi
 */
export interface ValueSansProvider {
  /**
   * The value to inject.
   */
  useValue: any;
}

/**
 * Configures the `Injector` to return a value for a token.
 * @see [Dependency Injection Guide](guide/di)
 *
 * @usageNotes
 *
 * ### Exampl

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key