Hands-on Angular 19 demo app that explains core Angular Router features with simple live examples powered by JSONPlaceholder data.
The app uses standalone pages and real route navigation to explain common routing patterns:
Static Route: fixed routes like/homeand/usersDynamic Route: route parameters with/users/:idNested Route: child route rendering with/users/:id/postsDeeper Route: selected post detail route with/users/:id/posts/:postIdLazy Loading: posts and post-detail pages are loaded withloadComponentWildcard Route: unknown paths are handled by**and routed to the 404 pageRoute Params + API: route parameters are used to fetch the correct user and post data
You can explore the routing flow in this order:
- Open
/home - Open
/users - Click a user to navigate to
/users/:id - Open
Poststo navigate to/users/:id/posts - Click a post to open
/users/:id/posts/:postId - Try
/demo-not-foundto trigger the wildcard route
- Angular version:
19.2.x - Style: standalone components with route-based navigation
- Root shell: navbar +
router-outletinapp.component.html - Data source:
https://jsonplaceholder.typicode.com
Configured in app.routes.ts:
/and/home-> homepage for the routing demo/users-> users list page/users/:id-> dynamic user detail page/users/:id/posts-> nested user posts page/users/:id/posts/:postId-> specific post detail page**-> not found page
ApiService: typed wrappers around JSONPlaceholder users/posts endpoints
shared/card: reusable card shell used across the users/posts viewsstyles.scss: shared layout, surface card, loader, error, and route-list styling
- Node.js 18+ (or current LTS)
- npm
npm installnpm startOpen http://localhost:4200/.
npm start- run dev servernpm run build- production buildnpm run watch- build in watch modenpm test- run unit tests (Karma/Jasmine)
src/app/
pages/
home-page/ # routing demo homepage
users-page/ # users list route
user-detail-page/ # dynamic user detail route
user-posts-page/ # nested posts route
user-post-detail-page/ # specific post detail route
not-found-page/ # wildcard route page
services/ # API service for users/posts
shared/card/ # reusable card shell
app.routes.ts # route definitions
app.component.* # app shell and navbar
- This project is intentionally demo-oriented and uses a public mock API.
- The homepage explains each routing feature and links to a live route example.
- User and post detail pages demonstrate how route params drive API requests.




