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

Built-in Pipes

Learn the commonly used built-in Angular Pipes for formatting strings, numbers, dates, currencies, and other values.

What are Built-in Pipes?

Angular provides several built-in pipes that can be used directly inside templates to transform and format data.

These pipes help display component data in a clean and user-friendly format without modifying the original value.

Built-in Pipe Flow

1
Original Value

Component contains the original data.

→
2
Pipe

A built-in pipe transforms the value.

→
3
Template

The transformed value is used in the template.

→
4
Output

The formatted value is displayed to the user.

Common Built-in Pipes

T
UpperCase

Converts text into uppercase characters.

uppercase
t
LowerCase

Converts text into lowercase characters.

lowercase
D
Date

Formats date values.

date
C
Currency

Formats numbers as currency.

currency

1. Uppercase Pipe

The uppercase pipe converts all characters in a string to uppercase.

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

2. Lowercase Pipe

The lowercase pipe converts all characters in a string to lowercase.

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

3. Date Pipe

The date pipe formats a date value into a readable format.

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

Date with Format

The date pipe can accept a format parameter.

Template
<p>
    {{joiningDate | date:'dd/MM/yyyy'}}
</p>
Example Output:
07/10/2026

4. Currency Pipe

The currency pipe formats numeric values as currency.

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

5. Number Pipe

The number pipe formats numeric values according to the specified digit information.

Component
percentage = 87.5678;
Template
<p>
    {{percentage | number:'1.2-2'}}
</p>
Output:
87.57

6. Percent Pipe

The percent pipe formats a number as a percentage.

Component
completion = 0.85;
Template
<p>
    {{completion | percent}}
</p>
Output:
85%

7. JSON Pipe

The json pipe is useful for displaying objects and arrays in JSON format, especially while debugging.

Component
student = {
    name: 'Sam',
    course: 'Angular',
    fee: 35000
};
Template
<pre>
    {{student | json}}
</pre>
Purpose:
Displays the object in JSON format for easier inspection.

8. Slice Pipe

The slice pipe creates a subset of an array or string for display.

Component
students = [
    'Sam',
    'Pradnya',
    'Samiksha',
    'Rahul'
];
Template
<p>
    {{students | slice:0:2}}
</p>
Purpose:
Displays a selected portion of the collection.

9. Async Pipe

The async pipe subscribes to an Observable or Promise and displays the emitted value.

Template
<p>
    {{studentData$ | async}}
</p>
Purpose:
Angular handles the subscription and updates the template when a new value is available.

Built-in Pipe Reference

Pipe Purpose Example
uppercase Convert text to uppercase {{name | uppercase}}
lowercase Convert text to lowercase {{name | lowercase}}
date Format dates {{date | date}}
currency Format currency {{fee | currency:'INR'}}
number Format numbers {{value | number}}
percent Format percentage {{value | percent}}
json Display objects as JSON {{student | json}}
slice Extract part of a value {{students | slice:0:2}}
async Handle Observable or Promise values {{data$ | async}}

Complete Student Example

student.component.ts
export class StudentComponent {

    studentName = 'Samiksha';

    courseFee = 35000;

    completion = 0.85;

    joiningDate = new Date();

    student = {
        name: 'Sam',
        course: 'Angular'
    };

}
student.component.html
<h3>
    {{studentName | uppercase}}
</h3>

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

<p>
    Completion:
    {{completion | percent}}
</p>

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

<pre>
    {{student | json}}
</pre>

SAMIKSHA

Course Fee: ₹35,000.00

Completion: 85%

Angular Student

Best Practices

  • Use built-in pipes whenever they satisfy the requirement.
  • Use pipes mainly for presentation and formatting.
  • Keep complex business logic outside the template.
  • Use parameters when customized formatting is required.
  • Use the JSON pipe mainly for debugging purposes.
  • Avoid unnecessary pipe chains in complex templates.

Summary

  • Angular provides many built-in pipes.
  • uppercase and lowercase format text.
  • date formats date values.
  • currency formats monetary values.
  • number formats numeric values.
  • percent formats percentages.
  • json helps inspect objects and arrays.
  • slice extracts a portion of a value.
  • async handles Observable and Promise values.