How 9elements/angular-workshop works
Main Components Layer
a) Basic Counter Component (self-managed state)
b) Service Counter Component (service-managed state)
c) NgRx Counter Component (Redux-style state)
• Standalone Service Counter as a variant of the Service Counter
State Management Layer
a) Component-level state (for basic counter)
b) Service-based state management (CounterService)
c) NgRx Store with:
• Actions (from /actions/counter.actions.ts)
• Reducers (from /reducers/counter.reducer.ts)
• Effects (from /effects/counter.effects.ts)
• Selectors (from /shared/selectors.ts)
Services Layer
• CounterApiService for backend communication
• CounterService for service-based state management
• Services to their respective components
Testing Infrastructure Layer
• Three testing approaches:
a) Unit Tests (*.spec.ts files)
b) Integration Tests (*.spectator.spec.ts files)
c) E2E Tests (Cypress tests in cypress/e2e/)
Data Flow
• HTTP interactions with the backend (assets/counter.json)
Specific Elements to Include:
┌─────────────────┐
• CounterComponent│
• ┘
State Management (Hexagons for NgRx elements)
⬡ NgRx Store
⬡ Effects
⬡ Actions
Services (Ovals)
⭕ CounterService
⭕ CounterApiService
┌ ─ ─ ─ ─ ─ ─ ─ ┐
• Testing Layer
• ┘
• Blue: Component-level elements
• Green: Service-level elements
• Orange: NgRx-related elements
• Purple: Testing infrastructure
• Gray: External systems/API
• → Direct communication
• ⇢ State updates
• ⇄ Two-way binding
• 📊 State storage
• 🧪 Test coverage
Important Notes:
Standalone nature of the StandaloneServiceCounter
• UI Components
• State Management
• Services
• Testing Infrastructure