A learning-focused Angular 19 app that demonstrates built-in pipes, custom pipes, async data handling, and pure vs impure behavior using small standalone demo components.
- Angular 19
- TypeScript
- SCSS
- RxJS
- 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/ # demo feature components
pipes/ # custom pipe implementations
services/ # API and counters used by demos
shared/ # reusable UI components (card/loading/user-item)
models/ # shared interfaces
- The app is bootstrapped with
bootstrapApplicationinsrc/main.ts. AppComponentrenders demo components directly insrc/app/app.component.html.- Router is configured, but
src/app/app.routes.tscurrently exports an empty route array. ComponentsModuleaggregates and exports standalone demo components.
UserServiceService uses JSONPlaceholder:
/users/posts/todos/photos/comments/albums
Service methods return fallback empty arrays on HTTP errors.
From src/app/app.component.html:
multiply-pipes- custommultiplypipe (number * factor)async-pipes-asyncpipe on an observable greetingobject-format-pipe- custom user formatter (objectFormatPipe)slice-pipes- built-inslicefor post title/body snippetstext-pipes-uppercase,lowercase,titlecasenumber-pipes-currency,number,percentdate-pipes- built-in date formatscustom-pipes- customcapitalizepipechaining-pipe- chained built-in pipes in one expressionfilter-pipes- custom name filter with search inputhttp-async-pipe-asyncpipe with HTTP user listdebug-pipe- custom debug pipe plus JSON visualizationjson-pipes- built-injsonoutput for selected usersort-pipe- custom sort for todos (completed,title,id)pure-vs-impure-pipe- side-by-side pure/impure pipe execution counters
default-pipeexists insrc/app/components/default-pipeand demonstrates fallback text viadefaultPipe, but it is not currently mounted inAppComponent.
Defined in src/app/pipes:
capitalize- uppercase first charactermultiply- multiplies numeric value by a factorfilter- filters users bynameusing search textsortPipe- type-safe generic sort (keyof T & string) for strings, numbers, booleansdefaultPipe- fallback value for empty/blank stringsdebugPipe- logs and returns the original valueobjectFormatPipe- formats user object for displaypureFilter- pure pipe used for execution behavior demoimpureFilter- impure pipe used for execution behavior demo
- Most demo components are standalone and imported through
ComponentsModulefor convenience. sort-pipecomponent usessortField: keyof Todoto keep template pipe arguments type-safe.PipeCounterServiceuses Angular signals to track pure and impure pipe execution counts.
