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

RxJS Operators

Learn how RxJS operators process Observable streams and how operators can be combined using the pipe() method.

What is an RxJS Operator?

An RxJS Operator is a function that works with an Observable stream and returns another Observable representing the processed stream.

Operators can be used for transformation, filtering, combination, timing, error handling and other stream-processing requirements.

RxJS operators are commonly combined inside the pipe() method.

RxJS Operator Flow

Source Observable
→
pipe() Processing Pipeline
→
Operators Process Stream
→
Result New Observable

Why Do We Use Operators?

T
Transform Data

Convert emitted values into the format required by the application.

F
Filter Data

Allow only required values to continue through the stream.

C
Combine Streams

Work with values from multiple Observable sources.

E
Handle Errors

Build stream-processing logic for error scenarios.

Using pipe()

The pipe() method is used to connect multiple RxJS operators together.

Operators are executed as part of the Observable processing pipeline.

Basic Syntax
const result$ = source$.pipe(

    operator1(),

    operator2(),

    operator3()

);

Operator Categories

T
Transformation

Changes or converts emitted values.

F
Filtering

Controls which values are allowed to continue.

C
Combination

Works with multiple Observable streams.

U
Utility

Supports timing, side effects and stream control.

Common RxJS Operators

Operator Category Purpose
map() Transformation Transforms each emitted value
filter() Filtering Keeps values matching a condition
tap() Utility Performs a side effect without changing the value
take() Filtering / Control Takes a specified number of emissions
catchError() Error Handling Handles an error in the stream
debounceTime() Timing Delays emission until the source remains quiet

Simple Operator Example

TypeScript
const numbers$ = of(
    10,
    20,
    30
);

const result$ = numbers$.pipe(

    map(value => value * 2)

);

result$.subscribe({

    next: value => {

        console.log(value);

    }

});

Output

20

40

60

Chaining Operators

More than one operator can be placed inside a single pipe().

This creates a processing pipeline where the result of one operator is passed to the next operator.

Example
const numbers$ = of(
    1,
    2,
    3,
    4,
    5
);

const result$ = numbers$.pipe(

    map(value => value * 10),

    filter(value => value > 20)

);
1 2 3 4 5 Source
→
map() × 10
→
filter() > 20
→
30 40 50 Final Values

Operators and Observable Immutability

RxJS operators generally create a new Observable representing the processed stream rather than directly changing the original Observable definition.

This makes stream-processing pipelines easier to compose and reason about.

Transformation Operators

M
map()

Converts each value into another value.

S
scan()

Accumulates state as values are emitted.

B
buffer()

Collects emitted values into grouped outputs.

F
format

Transformation logic can prepare data for application use.

Detailed transformation operators will be covered in the next topic, Transformation and Filtering.

Filtering Operators

F
filter()

Keeps values satisfying a condition.

T
take()

Takes a fixed number of emitted values.

S
skip()

Ignores a specified number of initial values.

D
distinct

Helps control repeated values in a stream.

Utility Operators

T
tap()

Useful for logging and debugging side effects.

D
debounceTime()

Controls rapid successive emissions using time.

C
catchError()

Provides error-handling behavior for a stream.

F
finalize()

Runs logic when an Observable terminates.

CIIT Training Institute Example

Suppose CIIT Training Institute receives course enquiry information through an Observable.

Operators can be placed in a pipeline to prepare the data before the dashboard receives the final result.

Course Enquiry Stream
const enquiries$ = of(
    'Java',
    '.NET',
    'Python'
);

const result$ = enquiries$.pipe(

    map(course =>
        course + ' enquiry'
    ),

    tap(enquiry => {

        console.log(
            'Processing:',
            enquiry
        );

    })

);

result$.subscribe({

    next: enquiry => {

        console.log(
            'Dashboard:',
            enquiry
        );

    }

});

CIIT Training Institute

Processing: Java enquiry

Processing: .NET enquiry

Processing: Python enquiry

Dashboard receives processed enquiry data

Choosing an Operator

Requirement Suitable Operator Purpose
Change a value map() Transform each emission
Keep matching values filter() Apply a condition
Inspect values tap() Perform a side effect
Limit emissions take() Take a fixed number of values
Handle errors catchError() Handle stream failures
Delay rapid events debounceTime() Control frequent emissions

Building a Good Operator Pipeline

1
Identify Source

Understand what values the Observable emits.

2
Define Requirement

Decide whether data must be transformed or filtered.

3
Select Operators

Choose operators that directly match the requirement.

4
Build Pipeline

Combine the selected operators inside pipe().

Important Points

1. Operators Process Streams

Operators are used to process values emitted by an Observable.

2. Operators Work with pipe()

Multiple operators can be combined through the pipe() method.

3. Different Operators Have Different Roles

Transformation, filtering, combination, timing and error-handling operators solve different problems.

4. Keep Pipelines Understandable

Select operators based on the actual business or application requirement.

RxJS Operator Best Practices

  • Choose an operator based on the exact stream-processing requirement.
  • Keep operator chains readable.
  • Avoid adding operators that do not contribute to the required result.
  • Use tap() mainly for side effects such as logging or debugging.
  • Handle important errors with suitable RxJS error-handling strategies.
  • Separate complex stream-processing logic into meaningful services or reusable methods where appropriate.

Summary

RxJS operators are functions used to process Observable streams.

Operators can transform, filter, combine, control and handle errors in data streams.

The pipe() method is used to compose operators into a processing pipeline. In the next topic, we will study Transformation and Filtering in detail.