Explain it simply
Built-in Pipes, in plain language
Pipes are used to transform/format data inside a template. Angular ships with a bunch of built-in pipes.
Problem → Why → Solution
The problem — why this concept matters
Formatting a server UTC timestamp without a deliberate timezone can display the wrong calendar day.
A common mistake
One happy-path result does not prove the feature works; empty, loading, error, and cleanup behavior need explicit tests.
Core concept — understand how it works
Pipes transform values for display without changing source data. Date, currency, and number pipes require explicit locale, timezone, and formatting policy for correct user-facing output. Pure pipes rerun when input references change, so mutable collections should use immutable updates.
- input and state
- component and template
- rendered Angular UI
Explain the core concept and Angular data flow of Built-in Pipes
Core syntax or pattern
<!-- String pipes -->
<p>{{ 'hello world' | uppercase }}</p> <!-- HELLO WORLD -->
<p>{{ 'HELLO WORLD' | lowercase }}</p> <!-- hello world -->
<p>{{ 'hello world' | titlecase }}</p> <!-- Hello World -->
<!-- Number pipes -->
<p>{{ 1234.5678 | number:'1.2-2' }}</p> <!-- 1,234.57 -->
<p>{{ 0.25 | percent }}</p> <!-- 25% -->
<p>{{ 99.99 | currency:'USD' }}</p> <!-- $99.99 -->
<!-- Date pipe -->
<p>{{ today | date:'short' }}</p> <!-- 10/16/25, 3:45 PM -->
<p>{{ today | date:'fullDate' }}</p> <!-- Thursday, October 16, 2025 -->
<p>{{ today | date:'dd/MM/yyyy' }}</p> <!-- 16/10/2025 -->
<!-- JSON pipe (for debugging) -->
<pre>{{ user | json }}</pre>
// component.ts
export class MyComponent {
today = new Date();
user = { name: 'John', age: 25 };
}Pipes transform values for display without changing source data. Date, currency, and number pipes require explicit locale, timezone, and formatting policy for correct user-facing output. Pure pipes rerun when input references change, so mutable collections should use immutable updates.
Read the code step by step
- input and state
<!-- String pipes -->Pipes are used to transform/format data inside a template. Angular ships with a bunch of built-in pipes.
- component and template
<p>{{ today | date:'short' }}</p> <!-- 10...Pipes transform values for display without changing source data. Date, currency, and number pipes require explicit locale, timezone, and formatting policy for correct user-facing output. Pure pipes rerun when input references change, so mutable collections should use immutable updates.
- rendered Angular UI
}Format an order summary with date, currency, and percent pipes, then test two locales, a timezone boundary, and null fallback.
- input and state
- component and template
- rendered Angular UI
Success
Explain the core concept and Angular data flow of Built-in Pipes
Failure
Formatting a server UTC timestamp without a deliberate timezone can display the wrong calendar day.
Pipes are used to transform/format data inside a template. Angular ships with a bunch of built-in pipes.
<!-- String pipes -->
<p>{{ 'hello world' | uppercase }}</p> <!-- HELLO WORLD -->
<p>{{ 'HELLO WORLD' | lowercase }}</p> <!-- hello world -->
<p>{{ 'hello world' | titlecase }}</p> <!-- Hello World -->
<!-- Number pipes -->
<p>{{ 1234.5678 | number:'1.2-2' }}</p> <!-- 1,234.57 -->
<p>{{ 0.25 | percent }}</p> <!-- 25% -->
<p>{{ 99.99 | currency:'USD' }}</p> <!-- $99.99 -->
<!-- Date pipe -->
<p>{{ today | date:'short' }}</p> <!-- 10/16/25, 3:45 PM -->
<p>{{ today | date:'fullDate' }}</p> <!-- Thursday, October 16, 2025 -->
<p>{{ today | date:'dd/MM/yyyy' }}</p> <!-- 16/10/2025 -->
<!-- JSON pipe (for debugging) -->
<pre>{{ user | json }}</pre>
// component.ts
export class MyComponent {
today = new Date();
user = { name: 'John', age: 25 };
}(The data gets transformed into the specified formats and displayed)Real-world usage
How to apply it in a real project
Format an order summary with date, currency, and percent pipes, then test two locales, a timezone boundary, and null fallback.
Mini challenge
Build it yourself
Rebuild the Built-in Pipes example without copying it. Add two normal states, one edge case, and one failure state, and write the expected UI and state transition before running it.
- Rebuild the example without copying it
- Test a normal input and an edge case
- Predict the compiler or output result before running it
<!-- String pipes -->
<p>{{ 'hello world' | uppercase }}</p> <!-- HELLO WORLD -->
<p>{{ 'HELLO WORLD' | lowercase }}</p> <!-- hello world -->
<p>{{ 'hello world' | titlecase }}</p> <!-- Hello World -->
<!-- Number pipes -->
<p>{{ 1234.5678 | number:'1.2-2' }}</p> <!-- 1,234.57 -->
<p>{{ 0.25 | percent }}</p> <!-- 25% -->
<p>{{ 99.99 | currency:'USD' }}</p> <!-- $99.99 -->
<!-- Date pipe -->
<p>{{ today | date:'short' }}</p> <!-- 10/16/25, 3:45 PM -->
<p>{{ today | date:'fullDate' }}</p> <!-- Thursday, October 16, 2025 -->
<p>{{ today | date:'dd/MM/yyyy' }}</p> <!-- 16/10/2025 -->
<!-- JSON pipe (for debugging) -->
<pre>{{ user | json }}</pre>
// component.ts
export class MyComponent {
today = new Date();
user = { name: 'John', age: 25 };
}Expected: Explain the core concept and Angular data flow of Built-in Pipes
Show hint
Format an order summary with date, currency, and percent pipes, then test two locales, a timezone boundary, and null fallback.
Quick quiz 1 / 3
Quick quiz 2 / 3
Quick quiz 3 / 3
What to remember
- input and state → component and template → rendered Angular UI
- Pipes transform values for display without changing source data. Date, currency, and number pipes require explicit locale, timezone, and formatting policy for correct user-facing output. Pure pipes rerun when input references change, so mutable collections should use immutable updates.
- Formatting a server UTC timestamp without a deliberate timezone can display the wrong calendar day.
- Format an order summary with date, currency, and percent pipes, then test two locales, a timezone boundary, and null fallback.
Angular — Templates — Angular