Skip to content

Angular demo for Signals based state for conversations (sequence of related application pages)

Notifications You must be signed in to change notification settings

janhalasa/angular-conversation-state

Repository files navigation

Angular Signals

Demo application for trying Angular Signals introduced in Angular 16.

To learn about Signals, see

Service based store for conversations

Conversation

Conversation is a sequence of related application pages that share a common state. For example:

  1. search form
  2. search result list
  3. single result detail

When you enter a conversation, you usually want a clean state and to preserve it while navigating the conversation. For example, when you return from a detail page to the result list, you want to see the same list as was displayed before.

In this demo application, there is one conversation implemented by FirstConversationComponent with two subpages. The conversation component contains a router-outlet and is a navigation parent for its subpages. When we leave the conversation route space, the conversation component gets destroyed along with its state service (provided by it).

A conversation can probably be implemented by an Angular module too.

Store

Based on the video of Joshua Morony My NEW default for state management in Angular.

This demo has one state service - FirstConversationStateService. This state service is based on Signals. It's not as sophisticated as NGRX Component Store but it's much simpler and easier to implement and understand.

How to run it

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory.

About

Angular demo for Signals based state for conversations (sequence of related application pages)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published