Master Angular From Scratch

Learn Angular with clear, interactive, and structured lessons for beginners and developers.

ANGULAR COURSE SYLLABUS
1. Angular Introduction
Angular Introduction Angular History Angular Fundamentals Angular Architecture Component-Based Angular
2. Angular Setup
Angular Setup Introduction Installing Node.js Installing Angular CLI Creating an Angular Application Angular Project Structure
3. Components
Components Overview Component Anatomy Creating Components Component Selector Component Template Component Styles Component Metadata Standalone Components Parent and Child Components Reusable Components
4. Templates
Templates Introduction Template Syntax Template Expressions Template Statements Template Reference Variables ng-template ng-container ngTemplateOutlet Built-in Control Flow
5. Data Binding
Data Binding Introduction Interpolation Binding Property Binding Event Binding Two-Way Data Binding Class & Style Binding
6. Directives
Directives Introduction Attribute Directives Structural Directives Custom Directives
7. Pipes
Pipes Introduction Built-in Pipes Parameterized Pipes Chaining Pipes Custom Pipes
8. Event Handling
Event Handling Introduction DOM Events Event Binding Syntax Event Object Passing Data to Event Handlers
9. Input & Output
Component Communication @Input @Output EventEmitter
10. Lifecycle Hooks
Lifecycle Hooks Introduction ngOnInit ngOnChanges ngAfterViewInit ngOnDestroy
11. Services
Services Introduction Creating Angular Services Using Services in Components Sharing Data Through Services Service Scope
12. Dependency Injection
Dependency Injection Introduction Injecting Dependencies InjectionToken Provider Configuration
13. Routing
Routing Introduction Route Configuration RouterLink & Navigation Route Parameters Child Routes Route Guards
14. Forms
Angular Forms Introduction Template-Driven Forms Reactive Forms Form Validation Form Submission & Error Handling
15. HttpClient
HttpClient Introduction Configuring HttpClient GET Request POST, PUT & DELETE Requests Headers & Parameters HTTP Error Handling
16. Observables
Observables Introduction Creating & Subscribing to Observables Observable Data Streams Observable Operators Subscription Management
17. RxJS
RxJS Introduction RxJS Operators Transformation & Filtering Combining Observables Higher-Order Mapping Subjects
18. API Integration
API Integration Introduction Connecting Angular with REST API Consuming API Data CRUD API Integration API Response & Error Handling

Chaining Pipes

Learn how Angular allows multiple Pipes to be combined together to transform and format data step by step.

What is Pipe Chaining?

Pipe chaining means using more than one Pipe in the same Angular template expression.

The output of one Pipe becomes the input for the next Pipe, allowing multiple transformations to be performed sequentially.

Pipe Chaining Flow

1
Original Data

Component provides the original value.

→
2
First Pipe

The first transformation is applied.

→
3
Second Pipe

The transformed value passes to another Pipe.

→
4
Final Output

The final formatted value is displayed.

Basic Chaining Syntax

Syntax
{{value | pipeOne | pipeTwo}}
Important:
The Pipes are executed from left to right.

Example 1: Uppercase and Slice

We can first convert a name to uppercase and then display only a portion of the result.

Component
studentName = 'Samiksha';
Template
<p>
    {{studentName | uppercase | slice:0:5}}
</p>
Flow:
Samiksha → SAMIKSHA → SAMIK

Example 2: Lowercase and Slice

Component
studentName = 'PRADNYA';
Template
<p>
    {{studentName | lowercase | slice:0:4}}
</p>
Flow:
PRADNYA → pradnya → prad

Example 3: Date Formatting

Date formatting can also be customized using a Pipe parameter.

Component
joiningDate = new Date();
Template
<p>
    {{joiningDate | date:'dd/MM/yyyy'}}
</p>
Result:
The date is displayed in the required format.

Using Multiple Pipes

More than two Pipes can also be combined when the output requires multiple transformations.

Example
{{studentName | uppercase | slice:0:6}}
Flow:
Original Value → Uppercase → Slice → Final Value

Chaining Pipes with Parameters

Pipes in a chain can also receive their own parameters.

Example
{{studentName | uppercase | slice:0:5}}
Explanation:
uppercase performs the first transformation, and slice receives its own parameters.

Single Pipe vs Chained Pipes

Type Syntax Purpose
Single Pipe {{name | uppercase}} One transformation
Two Pipes {{name | uppercase | slice:0:5}} Two transformations
Parameterized Pipe {{date | date:'dd/MM/yyyy'}} Customized formatting

Complete Student Example

student.component.ts
export class StudentComponent {

    student1 = 'Sam';

    student2 = 'Pradnya';

    student3 = 'Samiksha';

    joiningDate = new Date();

}
student.component.html
<h3>
    {{student1 | uppercase | slice:0:2}}
</h3>

<h3>
    {{student2 | uppercase | slice:0:5}}
</h3>

<h3>
    {{student3 | uppercase | slice:0:6}}
</h3>

<p>
    {{joiningDate | date:'dd/MM/yyyy'}}
</p>

SA

PRADN

SAMIKS


Date displayed using the Date Pipe.

Chaining Example Flow

Samiksha Original Value
→
uppercase SAMIKSHA
→
slice:0:6 SAMIKS

Best Practices

  • Use pipe chaining when multiple simple transformations are required.
  • Keep the chain short and readable.
  • Use parameters only when they are required.
  • Avoid very long and complex pipe chains.
  • Keep business logic outside template expressions.
  • Use custom Pipes when transformation logic becomes reusable and complex.

Summary

  • Pipe chaining combines multiple Pipes in one expression.
  • The output of one Pipe becomes the input of the next Pipe.
  • Pipes are applied from left to right.
  • Each Pipe can have its own parameters.
  • Chaining is useful for simple sequential transformations.
  • Very complex chains should be avoided for better readability.