Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ba140e0
WIP
JohannesHoppe Jun 11, 2026
8f94214
intro überarbeitung
JohannesHoppe Jun 12, 2026
9034bb5
wip
JohannesHoppe Jun 12, 2026
03e8ccb
material(ngrx): Teil 2 (Global Store) als sauberen 1:1-Port + Teil-3-…
JohannesHoppe Jun 12, 2026
888a8d8
material(ngrx): 4 Buch-Diagramme als SVG eingebunden
JohannesHoppe Jun 12, 2026
c9e685e
material(ngrx): Diagramm-Beschriftungen auf selectSignal() modernisiert
JohannesHoppe Jun 12, 2026
cb17f46
material(ngrx): Teil 1 - Fussnote zur Nachrichten-Historie gerettet +…
JohannesHoppe Jun 12, 2026
d744445
material(ngrx): Teil 2 fuer Angular 22 / NgRx modernisiert (Phase 2)
JohannesHoppe Jun 12, 2026
518cdcd
material(ngrx): Teil 2 Feinschliff nach Verifikation
JohannesHoppe Jun 12, 2026
1192b93
material(ngrx): Teil 3 (SignalStore) geschrieben + gegen ngrx.io veri…
JohannesHoppe Jun 12, 2026
1425860
material(ngrx): Review-Fixes Teil 1-3 (Sprache, Inhalt, Struktur)
JohannesHoppe Jun 13, 2026
7c5ce4b
material(ngrx): Teil 1 letzte formelle Sie-Anrede auf wir-Form (Serie…
JohannesHoppe Jun 13, 2026
a516afa
material(ngrx): Teil 2 + Teil 3 auf volle CRUD-Tiefe erweitert (Optio…
JohannesHoppe Jun 13, 2026
07d77cb
material(ngrx): lauffaehige Beispiel-Apps + Vitest-Beweis fuer Teil 2…
JohannesHoppe Jun 13, 2026
0dfabe7
material(ngrx): Beispiel-Apps auf Angular 22 angehoben (NgRx 21 via l…
JohannesHoppe Jun 13, 2026
cb1d7e7
material(ngrx): Audit-Fixes Texte + Code (alle drei Teile + beide Demos)
JohannesHoppe Jun 14, 2026
edb50a3
material(ngrx): Feinschliff – Versionshinweise, clearError-Parität, T…
JohannesHoppe Jun 14, 2026
455506e
material(ngrx): Angular-Namenskonvention – .component/.service-Suffix…
JohannesHoppe Jun 15, 2026
c7bab92
material(ngrx): Demos auf BookMonkey-Präfix bm- umgestellt (statt app-)
JohannesHoppe Jun 15, 2026
1f6b57f
material(ngrx): Beispielprojekt BookMonkey -> BookManager umbenannt
JohannesHoppe Jun 15, 2026
5674667
material(ngrx): Versionshinweise versionsunabhängig formuliert (wenig…
JohannesHoppe Jun 15, 2026
583ae28
material(ngrx): Versions-/Install-Hinweise ganz entfernt
JohannesHoppe Jun 15, 2026
2794540
material(ngrx): Demos ans aktuelle Buch (BookManager) angeglichen
JohannesHoppe Jun 17, 2026
f09b420
material(ngrx): Artikel Teil 1-3 aufs aktuelle Buch portiert (Text + …
JohannesHoppe Jun 17, 2026
953f02c
material(ngrx): Review-Fixes – alle 15 bestätigten Findings behoben
JohannesHoppe Jul 26, 2026
4b937be
material(ngrx): Simplify-Review umgesetzt (Demos + Artikel synchron)
JohannesHoppe Jul 26, 2026
e733695
material(ngrx): Demos auf NgRx 22.0.0-beta.0 (Peer-Match mit Angular 22)
JohannesHoppe Jul 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,687 changes: 1,687 additions & 0 deletions material/ngrx-global-store/README.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions material/ngrx-global-store/demo/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single
ij_typescript_use_double_quotes = false

[*.md]
max_line_length = off
trim_trailing_whitespace = false
43 changes: 43 additions & 0 deletions material/ngrx-global-store/demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
__screenshots__/

# System files
.DS_Store
Thumbs.db
12 changes: 12 additions & 0 deletions material/ngrx-global-store/demo/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 100,
"singleQuote": true,
"overrides": [
{
"files": "*.html",
"options": {
"parser": "angular"
}
}
]
}
4 changes: 4 additions & 0 deletions material/ngrx-global-store/demo/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
"recommendations": ["angular.ng-template"]
}
13 changes: 13 additions & 0 deletions material/ngrx-global-store/demo/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "ng serve",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: start",
"url": "http://localhost:4200/"
}
]
}
42 changes: 42 additions & 0 deletions material/ngrx-global-store/demo/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "Changes detected"
},
"endsPattern": {
"regexp": "bundle generation (complete|failed)"
}
}
}
},
{
"type": "npm",
"script": "test",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "Changes detected"
},
"endsPattern": {
"regexp": "bundle generation (complete|failed)"
}
}
}
}
]
}
24 changes: 24 additions & 0 deletions material/ngrx-global-store/demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Beispiel-App: Global Store mit NgRx

Lauffähige Angular-Anwendung zum Artikel **[State Management mit NgRx – Teil 2: Global Store](../README.md)**.

Sie zeigt den kompletten Code aus dem Artikel in Aktion: Buchliste laden, Bücher anlegen und löschen (mit Actions, Reducer, Selektoren und Effects) sowie Favoriten als reinen Client-State ohne Effect – inklusive Lade- und Fehleranzeige.

- **Angular** + **NgRx** (`@ngrx/store`, `@ngrx/effects`, `@ngrx/store-devtools`)
- Der Datenservice `BookStore` spricht per `HttpClient` die echte BookManager-API unter `https://api1.angular-buch.com` an – die App braucht also kein eigenes Backend, aber eine Internetverbindung. Legt man ein Buch mit einer bereits vergebenen ISBN an, antwortet die API mit HTTP 409 und die Fehleranzeige erscheint.
- Der Store ist mit `provideStoreDevtools()` instrumentiert: Mit installierter [Redux-DevTools-Extension](https://github.com/reduxjs/redux-devtools) lassen sich alle Actions und der State live beobachten (siehe Artikel).

> **Hinweis:** Die API ist eine öffentliche, geteilte Instanz – angelegte und gelöschte Bücher sehen also auch andere. Die Unit-Tests sprechen die API nicht an (`HttpTestingController`).

> **Projektstruktur:** Diese Demo ist eine abgeflachte Minimal-Reproduktion. Der Artikel beschreibt die Integration in den vollständigen BookManager (Feature-Ordner `books/store/…`); die Demo liegt dagegen flach unter `src/app/store/…`. Klassen-, Datei- und Selektornamen folgen in beiden Fällen denselben Angular-Konventionen (keine `.component`/`.service`-Suffixe).

## Befehle

```bash
npm install
npm test # Vitest: Reducer-, Selektor-, Effect-, Service- und Komponententests
npm start # ng serve
npm run build
```

Die Tests beweisen das State Management isoliert: Reducer als Pure Functions, Selektoren, Effects mit `provideMockActions`, der `BookStore`-Service mit `HttpTestingController` und die Komponente mit `provideMockStore`.
73 changes: 73 additions & 0 deletions material/ngrx-global-store/demo/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"packageManager": "npm"
},
"newProjectRoot": "projects",
"projects": {
"demo": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular/build:application",
"options": {
"browser": "src/main.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.css"
]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "4kB",
"maximumError": "8kB"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"buildTarget": "demo:build:production"
},
"development": {
"buildTarget": "demo:build:development"
}
},
"defaultConfiguration": "development"
},
"test": {
"builder": "@angular/build:unit-test"
}
}
}
}
}
Loading