Hands-on Angular 19 demo project to understand component communication patterns with clear, visual examples.
- Parent to Child using
@Input - Child to Parent using
@Output+EventEmitter - Template Reference Variable
@ViewChildparent-to-child method access- Content Projection with
ng-content - Sibling Communication via Parent
- Shared Service Communication
- BehaviorSubject-based Communication
- Signals-based Communication
- Live API Communication Playground (all patterns in one flow)
- Angular
19.2.x - Standalone components
- RxJS (
Subject,BehaviorSubject) - Angular Signals
- Angular
HttpClient - JSONPlaceholder API (
https://jsonplaceholder.typicode.com)
Install dependencies:
npm installStart app:
npm startOpen:
http://localhost:4200
Build:
npm run buildUnit tests:
npm testMain demo modules live under:
src/app/components/
Key feature folders:
understanding-input-parent-childunderstanding-output-child-parentunderstanding-template-referenceunderstanding-view-childunderstanding-content-projectionunderstanding-sibling-communicationunderstanding-shared-service-communicationunderstanding-behaviorsubject-communicationunderstanding-signals-communicationunderstanding-live-api-communication
Shared card UI:
src/app/shared/card/
The Live API Communication Playground demonstrates full data flow:
- Load live API users/posts into parent state
- Pass selected user to child (
@Input) - Emit event from child to parent to rotate posts (
@Output) - Send filter from sibling A to sibling B via parent
- Publish one message to Shared Service stream, BehaviorSubject, and Signal
- Observe values in receiver component
HttpClientis configured insrc/app/app.config.tsusingprovideHttpClient().- UI and input/button interactions are normalized through shared global styles in
src/styles.scss.
