Skip to content

alobuuls/angular-observable-state

Repository files navigation

πŸ”„ Angular Observable State

Angular TypeScript State Management Completed

Repository GitHub Stars Last Commit


πŸ“‘ Table of Contents


🌐 Live Demo

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


πŸ“– Description

Note

Angular 12 application that demonstrates state management using RxJS and BehaviorSubject to share information between components and pages.

The project showcases reactive programming concepts, centralized state management, component communication, and Angular architecture best practices through a simple but scalable implementation.


βš™οΈ 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-observable-state.git

cd angular-observable-state

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 simple state management architecture based on RxJS observables and a centralized service.

πŸ“¦ State Service

Responsible for:

  • Global state management
  • BehaviorSubject implementation
  • State updates
  • Observable subscriptions
  • Component communication

πŸ“¦ Page 1

Responsible for:

  • State emission
  • User input handling
  • Updating shared data

πŸ“¦ Page 2

Responsible for:

  • State subscription
  • Reactive data display
  • Observable consumption

πŸ“¦ Page 3

Responsible for:

  • Reading shared state
  • Updating shared state
  • Bidirectional communication

πŸ“¦ Main Module

Responsible for:

  • Application bootstrap
  • Route configuration
  • Dependency injection

✨ Features

  • πŸ”„ Shared state between pages
  • πŸ“‘ Communication with BehaviorSubject
  • ⚑ Reactive programming with RxJS
  • 🎯 Observable subscriptions
  • πŸ“¦ Centralized state management
  • 🧩 Decoupled component communication
  • 🌐 Angular Forms with ngModel
  • πŸš€ Real-time data updates
  • 🧠 Simple state management pattern
  • 🎯 Strong typing with TypeScript

πŸ›  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-observable-state/

β”œβ”€β”€ src/
β”‚
β”œβ”€β”€ app/
β”‚   β”‚
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ page-1/
β”‚   β”‚   β”œβ”€β”€ page-2/
β”‚   β”‚   └── page-3/
β”‚   β”‚
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── state.service.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ app.component.ts
β”‚   β”œβ”€β”€ app.module.ts
β”‚   └── app.routes.ts
β”‚
β”œβ”€β”€ environments/
β”‚   β”œβ”€β”€ environment.ts
β”‚   └── environment.prod.ts
β”‚
β”œβ”€β”€ angular.json
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

πŸ”₯ Best Practices Implemented

  • Centralized state management
  • Reactive programming with RxJS
  • Separation of concerns
  • Observable pattern implementation
  • Service-based architecture
  • Decoupled component communication
  • Strong typing with TypeScript
  • Dependency injection
  • Scalable state management structure
  • Angular modular organization

🎯 Project Goal

Practice and strengthen Angular state management concepts through the implementation of a reactive application:

  • RxJS Fundamentals
  • BehaviorSubject
  • Observable Pattern
  • Shared State Management
  • Component Communication
  • Angular Services
  • Dependency Injection
  • Reactive Programming
  • TypeScript
  • Front-End Architecture

πŸ“„ License

This project is intended for educational and portfolio purposes.

Created by Alondra Francisco.

About

Angular example of reactive state sharing with BehaviorSubject and service-based state management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors