Back to list
psh-inc

angular

by psh-inc

0🍴 0📅 Jan 24, 2026

SKILL.md


name: angular description: | Angular 17 standalone components, RxJS patterns, and reactive forms for the casino platform. Use when: Building Angular components, services, guards, interceptors, or working with RxJS observables in casino-f or casino-customer-f. allowed-tools: Read, Edit, Write, Glob, Grep, Bash

Angular Skill

Angular 17 standalone component patterns for the casino platform's dual-frontend architecture. The customer frontend (casino-customer-f/) uses standalone components exclusively, while the admin frontend (casino-f/) uses a module-based approach. Both require strict RxJS subscription cleanup with takeUntil and use OnPush change detection for performance.

Quick Start

Standalone Component

@Component({
  selector: 'app-player-list',
  standalone: true,
  imports: [CommonModule, RouterModule],
  templateUrl: './player-list.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class PlayerListComponent implements OnInit, OnDestroy {
  private destroy$ = new Subject<void>();
  players$ = new BehaviorSubject<Player[]>([]);

  constructor(private playerService: PlayerService) {}

  ngOnInit(): void {
    this.playerService.list().pipe(
      takeUntil(this.destroy$),
      map(page => page.content)
    ).subscribe(players => this.players$.next(players));
  }

  ngOnDestroy(): void {
    this.destroy$.next();
    this.destroy$.complete();
  }
}

Service with State Management

@Injectable({ providedIn: 'root' })
export class WalletService implements OnDestroy {
  private balance$ = new BehaviorSubject<PlayerBalance | null>(null);
  private destroy$ = new Subject<void>();

  getBalance(): Observable<PlayerBalance | null> {
    return this.balance$.asObservable();
  }

  refreshBalance(playerId: number): void {
    this.http.get<PlayerBalance>(`${this.apiUrl}/${playerId}/balance`).pipe(
      takeUntil(this.destroy$),
      catchError(error => {
        console.error('Balance fetch failed:', error);
        return of(null);
      })
    ).subscribe(balance => this.balance$.next(balance));
  }

  ngOnDestroy(): void {
    this.destroy$.next();
    this.destroy$.complete();
  }
}

Key Concepts

ConceptUsageExample
StandaloneAll new componentsstandalone: true in decorator
CleanupEvery subscriptiontakeUntil(this.destroy$)
StateService-level stateBehaviorSubject<T>
PerformanceList renderingtrackBy + OnPush
FormsAll user inputReactive forms with FormGroup

Common Patterns

HTTP with Error Handling

When: Any API call

this.http.post<Resource>(this.apiUrl, request).pipe(
  catchError(error => {
    console.error('Create failed:', error);
    return throwError(() => error);
  })
);

Form with Validation

When: User data entry

this.form = this.fb.group({
  email: ['', [Validators.required, Validators.email]],
  amount: [null, [Validators.required, Validators.min(0)]]
});

See Also

  • hooks - Lifecycle hooks and cleanup patterns
  • components - Component structure and standalone patterns
  • data-fetching - HTTP services and caching
  • state - BehaviorSubject and state management
  • forms - Reactive forms and validation
  • performance - OnPush, trackBy, and optimization
  • See the typescript skill for type definitions and interfaces
  • See the spring-boot skill for backend API patterns
  • See the playwright skill for E2E testing
  • See the frontend-design skill for CSS and UI patterns

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon