A learning-focused Angular 19 app that demonstrates core Angular data binding patterns using small standalone demo components, reusable cards, and live API-backed examples for users, posts, todos, and photos.
- Angular 19
- TypeScript
- SCSS
- RxJS
- Angular Forms
- Angular Signals
- JSONPlaceholder API
- Picsum Photos API
- Node.js 18+ (latest LTS recommended)
- npm
npm installnpm startThe app runs at http://localhost:4200/.
npm start- start development servernpm run build- create production buildnpm run watch- build in watch mode (developmentconfig)npm test- run Karma unit tests
src/
app/
components/ # standalone demo components for each binding type
services/ # API service for users, posts, todos, and photos
shared/ # reusable UI components (card)
- The app is bootstrapped with
bootstrapApplicationinsrc/main.ts. - Global providers are configured in
src/app/app.config.ts, including router setup andprovideHttpClient(). AppComponentrenders the full binding playground and introduces the demos with a page title and subtitle.- Shared API access is centralized in
src/app/services/api-service.service.ts. - The page is split into standalone components for readability:
db-interpolationdb-property-bindingdb-event-bindingdb-two-way-bindingdb-class-bindingdb-style-bindingdb-attribute-bindingdb-pipe-bindingdb-safe-navigationdb-async-pipedb-signal-binding
From src/app/app.component.html:
db-interpolation- renders user values with{{ ... }}db-property-binding- binds image and element properties from Picsum photo datadb-event-binding- reacts to button clicks and post selection changesdb-two-way-binding- demonstrates[(ngModel)]with template-driven validationdb-class-binding- toggles CSS classes using todo completion statedb-style-binding- applies dynamic inline styles using todo datadb-attribute-binding- bindsaria,title, anddata-*attributes on postsdb-pipe-binding- formats post values with Angular built-in pipesdb-safe-navigation- safely reads nested user data with?.db-async-pipe- unwraps users from an observable in the templatedb-signal-binding- manages todo state with Angular signals and computed values
The app uses a small service layer in src/app/services/api-service.service.ts to keep the demos simple and consistent.
Current endpoints:
getUsers()-https://jsonplaceholder.typicode.com/usersgetPosts()-https://jsonplaceholder.typicode.com/postsgetTodos()-https://jsonplaceholder.typicode.com/todosgetPhotos()-https://picsum.photos/v2/list
Defined in src/app/shared:
app-card- reusable projected card layout used across all binding demos
- The app mixes observable-based and synchronous state patterns so each binding type can be demonstrated in a focused way.
- Most demos intentionally limit the number of rendered API items to keep the UI small and easy to compare.
- The two-way binding example uses template-driven validation to mirror common reactive-form validation concepts.
- The signal binding example uses Angular signals and computed values instead of RxJS in the component state layer.
- Unit tests use mocked service responses so the demos do not depend on live network access during test runs.
