Skip to content

alobuuls/angular-observables-state-pattern

Repository files navigation

πŸ”„ Angular Observables State Pattern

Angular TypeScript RxJS Completed

Repository GitHub Stars Last Commit


πŸ“‘ Table of Contents


🌐 Live Demo

πŸ”— https://alobuuls.github.io/angular-observables-state-pattern/


πŸ“– Description

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.


βš™οΈ System Requirements

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

πŸ” Verify Installed Versions

Run the following commands in your terminal:

node -v
npm -v
ng version

πŸš€ Project Installation

1️⃣ Clone the repository

git clone git@github.com:alobuuls/angular-observables-state-pattern.git

cd angular-observables-state-pattern

2️⃣ Install dependencies

npm install

▢️ Run the Project

Start the development server:

ng serve

Then open:

http://localhost:4200

🧠 Project Architecture

The application follows a modular communication architecture focused on RxJS observables and reusable Angular components.

πŸ“¦ State Service

Responsible for:

  • Shared state management
  • BehaviorSubject implementation
  • Observable streams
  • State updates
  • Component synchronization

πŸ“¦ Page One

Responsible for:

  • Data emission
  • State updates
  • Parent-child communication

πŸ“¦ Page Two

Responsible for:

  • Manual observable subscriptions
  • Subscription lifecycle management
  • Reactive data consumption

πŸ“¦ Page Three

Responsible for:

  • Async Pipe implementation
  • Reactive state updates
  • Observable-based rendering

πŸ“¦ Form Component

Responsible for:

  • User input management
  • Event emission
  • Reusable form logic

πŸ“¦ Card Component

Responsible for:

  • Data presentation
  • Reusable UI rendering
  • Input-based communication

✨ Features

  • πŸ”„ 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

πŸ›  Technologies Used

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

πŸ“ Project Structure

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

πŸ”₯ Best Practices Implemented

  • 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

🎯 Project Goal

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

πŸ“„ License

This project is intended for educational and portfolio purposes.

Created by Alondra Francisco.

About

Angular app demonstrating component communication and shared state management using RxJS BehaviorSubject and Observables.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors