angular-standalone-components
/angular-standalone-components
Tworzy aplikacje Angular na komponentach standalone, z sygnałami, funkcją inject() i nowoczesnym routingiem.
- Autor
- nextboxis ↗
- Repozytorium
- library-skill-agents ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 28.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 28.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Tworzy aplikacje Angular na komponentach standalone, z sygnałami, funkcją inject() i nowoczesnym routingiem.
Oryginalny opis (EN)
Use this skill when developing Angular applications using standalone components, signals reactivity, inject() dependency injection, and modern routing.
Jak działa
- When to use
- Prerequisites
- Step-by-step workflow
- Commands / code examples
- Common mistakes & pitfalls
- Verification checklist
- Related skills
Podgląd SKILL.md
---
name: angular-standalone-components
description: Use this skill when developing Angular applications using standalone components, signals reactivity, inject() dependency injection, and modern routing.
---
# Angular Standalone Components
## When to use
Use this skill when scaffolding new Angular applications, refactoring legacy NgModule architectures, or implementing fine-grained signals reactivity.
## Prerequisites
- Node.js 18.19+ and Angular CLI 17+ installed (`npm i -g @angular/cli`).
- Familiarity with TypeScript decorators and reactive streams (RxJS).
## Step-by-step workflow
1. **Generate standalone components**: Generate components using `ng g c <name> --standalone` (the default in modern Angular).
2. **Explicitly import dependencies**: Import required directives (`CommonModule`, `RouterLink`, custom components) into component `imports` arrays.
3. **Adopt Angular Signals**: Replace local state with `signal()` and derived properties with `computed()` for fine-grained reactivity.
4. **Use functional dependency injection**: Replace constructor injection with modern `inject(ServiceClass)` tokens.
5. **Configure standalone routing**: Define route trees using `provideRouter()` and standalone route files without AppRoutingModule.
## Commands / code examples
```ts
import { Component, signal, computed, inject } from '@angular/core';
import { CommonModule } from '@angular/common';
import { UserService } from '../services/user.service';
@Component({
selector: 'app-user-profile',
standalone: true,
imports: [CommonModule],
template: `
<div class="user-card">
<h2>{{ displayName() }}</h2>
<p>Role: {{ userRole() }}</p>
<button (click)="refresh()">Reload Profile</button>
</div>
`
})
export class UserProfileComponent {
private userService = inject(UserService);
user = signal({ firstName: 'Jane', lastName: 'Doe', role: 'Engineer' });
displayName = computed(() => `${this.user().firstName} ${this.user().lastName}`);
userRole = computed(() => this.user().role);
refresh() {
this.user.set({ firstName: 'Jane', lastName: 'Doe', role: 'Lead Architect' });
}
}
```
## Common mistakes & pitfalls
- Forgetting to import necessary directives (like `CommonModule` or `NgIf`) in component `imports`, causing runtime template errors.
- Calling signals without parentheses in templates (`user` instead of `user()`).
- Maintaining unnecessary NgModules in new projects, complicating dependency graphs.
## Verification checklist
- [ ] Component decorator sets `standalone: true`.
- [ ] All required sub-components and directives are declared in the `imports` array.
- [ ] `inject()` function is used for clean dependency injection.
- [ ] Signals are used for local reactive state instead of manual RxJS BehaviorSubjects where appropriate.
## Related skills
- typescript-advanced-type-system
- unit-testing-principles-aaa-pattern
- forms-validation-react-hook-form
- modern-css-layout-grid-flexbox
Wersje
W bazie nie ma innych skilli o nazwie angular-standalone-components.
Migawka bazy z 13.11.2026 · wersja paczki 9c1987c81ca0 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100angular-dependency-injection
Konfiguruje wstrzykiwanie zależności w Angularze, użycie inject() i providerów. - 100angular
Prowadzi pracę z Angularem 17 i nowszym: komponenty standalone, signals, serwisy, wstrzykiwanie zależności i wzorce reaktywne. - 100angular
Pomaga tworzyć aplikacje Angular: komponenty standalone, signals, trasy lazy, strażniki, interceptory i formularze reaktywne, w tym aktualizację starszych projektów. - 100angular-architect
Pomaga budować aplikacje Angular 17+ z komponentami standalone i sygnałami: aplikacje korporacyjne, RxJS, NgRx, optymalizacja wydajności i rozbudowany routing. - 100angular
Eksperckie wsparcie w Angularze: Signals, komponenty standalone, wstrzykiwanie zależności, RxJS i SSR dla przedsiębiorczych aplikacji jednostronicowych. - 90angular-architecture
Układa strukturę aplikacji Angular 17 lub nowszej: komponenty standalone, organizację według funkcji, leniwe ładowanie i sygnały dla stanu.