angular-dependency-injection
БесплатноБез исполняемых скриптовНе проверенConfigure DI, inject() usage, and providers in Angular. Use when configuring Angular dependency injection, using inject(), or defining providers.
от HoangNguyen0403★ 598 звёзд на GitHubОб этом скилле
Dependency Injection
Priority: P0 (CRITICAL)
Principles
inject()over Constructor: Use inject(MyService) function in class fields or constructor-equivalent class positions for cleaner injection. It works in any injection context (class fields, factory functions, guards).- Tree Shaking: Always use @Injectable({ providedIn: 'root' }) for app-wide singletons unless specific scoping required.
- Tokens: Use new InjectionToken
('description') for configuration, primitives, or interface abstraction. Provide via: { provide: API_URL, useValue: 'https://api.example.com' } inapp.config.ts. Inject with: inject(API_URL).
Guidelines
- Providers: Prefer provide*() functions (e.g., provideHttpClient()) in
app.config.tsproviders array over importing NgModules. - Factories: Use
useFactorystrictly when dependencies need runtime configuration. - App Initializer: Use provideAppInitializer(() => inject(ConfigService).load()) (Angular 19+) to run async code before app bootstrap — replaces old
APP_INITIALIZERtoken pattern. - Route Providers: Scope services to route tree using providers: [MyService] in route config ( routes array) instead of
providedIn: 'root'. This creates instance destroyed when leaving route. - Multi Providers: Use { provide: TOKEN, useClass: Impl, multi: true } to collects all multi providers into array (e.g., HTTP_INTERCEPTORS, validators).
Anti-Patterns
- No
providedIn: 'platform': Use'root'scoping; reserve platform only for Micro Frontend sharing. - No
forwardRef: Refactor architecture to eliminate circular dependencies instead.
References
Установить angular-dependency-injection в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл angular-dependency-injection?
Configure DI, inject() usage, and providers in Angular. Use when configuring Angular dependency injection, using inject(), or defining providers.
Как установить скилл angular-dependency-injection?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл angular-dependency-injection запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic