angular-di 是做什麼的?
在 Angular v20+ 中使用 inject()、注入令牌和提供者配置來實現依賴注入。用於服務架構、在不同層級提供依賴、建立可注入令牌,以及管理單例與作用域服務。觸發時機包括:服務建立、配置提供者、使用注入令牌,或理解 DI 階層。
在 Angular v20+ 中使用 inject()、注入令牌和提供者配置來實現依賴注入。用於服務架構、在不同層級提供依賴、建立可注入令牌,以及管理單例與作用域服務。
此技能專門處理 Angular v20+ 中的依賴注入(DI)模式。它指導開發者如何利用 `inject()` 函數、定義注入令牌(Injection Token)以及配置提供者(Provider)來構建穩固的服務層架構。技能涵蓋了在不同層級(如根層級、元件層級或惰性載入模組)提供依賴、創建可注入令牌以及管理服務為單例(Singleton)或作用域(Scoped)實例的關鍵概念。透過此技能,AI 能夠在需要建立新服務、配置提供者陣列、使用自訂注入令牌或需要釐清 DI 階層關係時提供精準協助。它適用於所有主流的 Angular 基於 AI 的代碼編輯工具(如 Cursor、Codex、Claude Code)及開發環境。
npx skills add https://github.com/analogjs/angular-skills/tree/main/skills/angular-diInstalled? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →
在 Angular v20+ 中使用 inject()、注入令牌和提供者配置來實現依賴注入。用於服務架構、在不同層級提供依賴、建立可注入令牌,以及管理單例與作用域服務。觸發時機包括:服務建立、配置提供者、使用注入令牌,或理解 DI 階層。
This repo contains 9 individual skills — each has its own dedicated page.
Create modern Angular standalone components following v20+ best practices. Use for building UI components with signal-based inputs/outputs, OnPush change detection, host bindings, content projection, and lifecycle hooks. Triggers on component creation, refactoring class-based inputs to signals, adding host bindings, or implementing accessible interactive components.
Create custom directives in Angular v20+ for DOM manipulation and behavior extension. Use for attribute directives that modify element behavior/appearance, structural directives for portals/overlays, and host directives for composition. Triggers on creating reusable DOM behaviors, extending element functionality, or composing behaviors across components. Note - use native @if/@for/@switch for control flow, not custom structural directives.
Build signal-based forms in Angular v21+ using the new Signal Forms API. Use for form creation with automatic two-way binding, schema-based validation, field state management, and dynamic forms. Triggers on form implementation, adding validation, creating multi-step forms, or building forms with conditional fields. Signal Forms are experimental but recommended for new Angular projects. Don't use for template-driven forms without signals or third-party form libraries like Formly or ngx-formly.
Implement HTTP data fetching in Angular v20+ using resource(), httpResource(), and HttpClient. Use for API calls, data loading with signals, request/response handling, and interceptors. Triggers on data fetching, API integration, loading states, error handling, or converting Observable-based HTTP to signal-based patterns.
Implement routing in Angular v20+ applications with lazy loading, functional guards, resolvers, and route parameters. Use for navigation setup, protected routes, route-based data loading, and nested routing. Triggers on route configuration, adding authentication guards, implementing lazy loading, or reading route parameters with signals.
Implement signal-based reactive state management in Angular v20+. Use for creating reactive state with signal(), derived state with computed(), dependent state with linkedSignal(), and side effects with effect(). Triggers on state management questions, converting from BehaviorSubject/Observable patterns to signals, or implementing reactive data flows.
Implement server-side rendering and hydration in Angular v20+ using @angular/ssr. Use for SSR setup, hydration strategies, prerendering static pages, and handling browser-only APIs. Triggers on SSR configuration, fixing hydration mismatches, prerendering routes, or making code SSR-compatible.
Write unit and integration tests for Angular v20+ applications using Vitest or Jasmine with TestBed and modern testing patterns. Use for testing components with signals, OnPush change detection, services with inject(), and HTTP interactions. Triggers on test creation, testing signal-based components, mocking dependencies, or setting up test infrastructure. Don't use for E2E testing with Cypress or Playwright, or for testing non-Angular JavaScript/TypeScript code.
Use Angular CLI and development tools effectively in Angular v20+ projects. Use for project setup, code generation, building, testing, and configuration. Triggers on creating new projects, generating components/services/modules, configuring builds, running tests, or optimizing production builds. Don't use for Nx workspace commands, custom Webpack configurations, or non-Angular CLI build systems like Vite standalone or esbuild direct usage.
Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.
Control Eight Sleep pods (status, temperature, alarms, schedules).
BluOS CLI (blu) for discovery, playback, grouping, and volume.
Create, search, and manage Bear notes via grizzly CLI.
Capture frames or clips from RTSP/ONVIF cameras.
Search GIF providers with CLI/TUI, download results, and extract stills/sheets.