π https://alobuuls.github.io/angular-observables-state-pattern/
Note
Angular 12 application that demonstrates multiple component communication patterns and state management techniques using RxJS and BehaviorSubject.
The project explores communication through @Input, @Output, shared services, manual subscriptions, and the Async Pipe while following Angular best practices and reusable component architecture.
Before running the project, make sure you have installed:
- π¦ Node.js:
v12.14.x β v14.x(recommended: v14.21.3 LTS) - π¦ npm:
v6+ π °οΈ Angular CLI:v12.x
Run the following commands in your terminal:
node -v
npm -v
ng versiongit clone git@github.com:alobuuls/angular-observables-state-pattern.git
cd angular-observables-state-patternnpm installStart the development server:
ng serveThen open:
http://localhost:4200
The application follows a modular communication architecture focused on RxJS observables and reusable Angular components.
Responsible for:
- Shared state management
- BehaviorSubject implementation
- Observable streams
- State updates
- Component synchronization
Responsible for:
- Data emission
- State updates
- Parent-child communication
Responsible for:
- Manual observable subscriptions
- Subscription lifecycle management
- Reactive data consumption
Responsible for:
- Async Pipe implementation
- Reactive state updates
- Observable-based rendering
Responsible for:
- User input management
- Event emission
- Reusable form logic
Responsible for:
- Data presentation
- Reusable UI rendering
- Input-based communication
- π Shared state with BehaviorSubject
- π‘ Observable-based communication
- π€ @Output event emission
- π₯ @Input property binding
- β‘ Async Pipe implementation
- π Manual subscription management
- π§© Reusable Angular components
- π§ Reactive state updates
- π¦ Service-based architecture
- π― Strong typing with TypeScript
- π Component communication patterns
| Technology | Purpose |
|---|---|
| Angular 12 | Framework |
| TypeScript | Application Logic |
| RxJS | Reactive Programming |
| BehaviorSubject | State Management |
| Angular Forms | Form Handling |
| Angular Router | Navigation |
| HTML5 | Structure |
| CSS3 | Styling |
angular-observables-state-pattern/
βββ src/
β
βββ app/
β β
β βββ components/
β β βββ card/
β β βββ form/
β β
β βββ pages/
β β βββ page-one/
β β βββ page-two/
β β βββ page-three/
β β
β βββ services/
β β βββ state.service.ts
β β
β βββ interfaces/
β β βββ data.interface.ts
β β
β βββ routes.ts
β βββ app.module.ts
β
βββ environments/
β βββ environment.ts
β βββ environment.prod.ts
β
βββ angular.json
βββ package.json
βββ tsconfig.json
βββ README.md
- Reactive programming with RxJS
- Centralized state management
- Separation of concerns
- Component communication patterns
- Smart use of Async Pipe
- Subscription lifecycle management
- Strong typing with TypeScript interfaces
- Reusable component architecture
- Service abstraction
- Scalable Angular organization
Practice and strengthen Angular communication and state management concepts through the implementation of different reactive patterns:
- RxJS Fundamentals
- BehaviorSubject
- Shared State Management
- @Input / @Output Communication
- Async Pipe
- Observable Subscriptions
- Component Architecture
- Angular Services
- Dependency Injection
- Front-End Architecture
This project is intended for educational and portfolio purposes.
Created by Alondra Francisco.