Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 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
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,661 changes: 1,661 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
5 changes: 5 additions & 0 deletions material/ngrx-global-store/demo/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# NgRx 21 deklariert als Peer-Range noch "@angular/core: ^21.0.0".
# Die Bibliothek laeuft aber problemlos unter Angular 22 (PR ngrx/platform#5155).
# Damit ein einfaches "npm install" nicht an dieser Peer-Range scheitert,
# ignorieren wir die Peer-Dependency-Pruefung (entspricht "npm install --legacy-peer-deps").
legacy-peer-deps=true
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"]
}
20 changes: 20 additions & 0 deletions material/ngrx-global-store/demo/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// 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/"
},
{
"name": "ng test",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: test",
"url": "http://localhost:9876/debug.html"
}
]
}
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)"
}
}
}
}
]
}
21 changes: 21 additions & 0 deletions material/ngrx-global-store/demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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 sowie Bücher anlegen, ändern (Bewertung erhöhen) und löschen (CRUD) mit Actions, Reducer, Selektoren und Effects – inklusive Lade- und Fehleranzeige.

- **Angular** + **NgRx** (`@ngrx/store`, `@ngrx/effects`)
- Der `BookApi` ist ein In-Memory-Stand-in für ein echtes HTTP-Backend, damit die App ohne Server läuft. Er wirft bei einer doppelten ISBN bewusst einen Fehler, sodass sich die Fehleranzeige auch ohne Server auslösen lässt.

> **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 (Präfix `bm-`, keine `.component`/`.service`-Suffixe) folgen in beiden Fällen denselben Angular-Konventionen.

## Befehle

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

Die Tests beweisen das State Management isoliert: Reducer als Pure Functions, Selektoren, Effects mit `provideMockActions` 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