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

Pipes Introduction

Learn how Angular Pipes transform and format data directly inside templates without changing the original component data.

What are Pipes?

Pipes are Angular features used to transform and format data before displaying it in the template.

They are useful for formatting dates, numbers, currency, text, and other values in a readable way.

Pipe Flow

1
Component Data

Data is defined inside the component.

→
2
Pipe

The pipe transforms the value.

→
3
Template

The transformed value is displayed.

→
4
UI

The formatted data appears to the user.

Basic Pipe Syntax

Angular Template
{{value | pipeName}}
Example:
{{ "SAM" | lowercase }}

Common Angular Pipes

T
UpperCase

Converts text into uppercase characters.

uppercase
L
LowerCase

Converts text into lowercase characters.

lowercase
D
Date

Formats date values for display.

date
C
Currency

Formats numbers as currency values.

currency

Uppercase Pipe

The uppercase pipe converts a string into uppercase characters.

Component
studentName = 'Samiksha';
HTML
<p>
    {{studentName | uppercase}}
</p>
Output:
SAMIKSHA

Lowercase Pipe

The lowercase pipe converts a string into lowercase characters.

HTML
<p>
    {{studentName | lowercase}}
</p>
Output:
samiksha

Date Pipe

The date pipe formats date values into readable formats.

Component
joiningDate = new Date();
HTML
<p>
    {{joiningDate | date}}
</p>
Output:
The date is displayed in a formatted form.

Currency Pipe

The currency pipe formats a number as a currency value.

Component
courseFee = 35000;
HTML
<p>
    {{courseFee | currency:'INR'}}
</p>
Output:
₹35,000.00

Pipe with Parameters

Some pipes accept parameters to control how the value should be formatted.

Example
{{courseFee | currency:'INR'}}
Explanation:
'INR' is passed as a parameter to the currency pipe.

Using Multiple Pipes

Multiple pipes can be chained together when more than one transformation is required.

Example
{{studentName | uppercase}}
Output:
SAMIKSHA

Student Data Examples

Component
student1 = 'Sam';
student2 = 'Pradnya';
student3 = 'Samiksha';

courseFee = 35000;

joiningDate = new Date();
Template
<p>{{student1 | uppercase}}</p>

<p>{{student2 | lowercase}}</p>

<p>{{student3 | uppercase}}</p>

<p>{{courseFee | currency:'INR'}}</p>

<p>{{joiningDate | date}}</p>

Student Information

Sam

Pradnya

Samiksha


Course Fee: ₹35,000.00

Benefits of Pipes

F
Formatting

Display data in a user-friendly format.

C
Clean Templates

Keep common formatting logic simple.

R
Reusable

Built-in pipes can be reused across templates.

D
Readable Data

Convert raw values into readable UI output.

Common Pipe Reference

Pipe Purpose Example
uppercase Convert text to uppercase {{name | uppercase}}
lowercase Convert text to lowercase {{name | lowercase}}
date Format date {{date | date}}
currency Format currency {{fee | currency:'INR'}}

Best Practices

  • Use pipes mainly for presentation and formatting.
  • Keep complex business logic outside the template.
  • Use meaningful pipe parameters.
  • Use built-in pipes whenever they satisfy the requirement.
  • Create custom pipes when reusable transformation logic is required.
  • Avoid unnecessary pipe chains in complex templates.

Summary

  • Pipes transform and format data in Angular templates.
  • The pipe operator is represented using |.
  • uppercase converts text to uppercase.
  • lowercase converts text to lowercase.
  • date formats date values.
  • currency formats currency values.
  • Pipes can accept parameters for customized formatting.