UNPKG

@angular/core

Version:

Angular - the core framework

40 lines (36 loc) 993 B
/** * @license Angular v21.0.6 * (c) 2010-2025 Google LLC. https://angular.dev/ * License: MIT */ let _currentInjector = undefined; function getCurrentInjector() { return _currentInjector; } function setCurrentInjector(injector) { const former = _currentInjector; _currentInjector = injector; return former; } function inject(token, options) { const currentInjector = getCurrentInjector(); if (!currentInjector) { throw new Error('Current injector is not set.'); } if (!token.ɵprov) { throw new Error('Token is not an injectable'); } return currentInjector.retrieve(token, options); } const NOT_FOUND = Symbol('NotFound'); class NotFoundError extends Error { name = 'ɵNotFound'; constructor(message) { super(message); } } function isNotFound(e) { return e === NOT_FOUND || e?.name === 'ɵNotFound'; } export { NOT_FOUND, NotFoundError, getCurrentInjector, inject, isNotFound, setCurrentInjector }; //# sourceMappingURL=_not_found-chunk.mjs.map