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

Component-Based Angular

Understand how Angular applications are built using reusable and independent components.

What is Component-Based Angular?

Angular applications are built using components. A component represents a specific part of the application's user interface and contains the logic required to manage it.

Instead of building the complete application in one large page, Angular divides the application into smaller, reusable components.

Component-Based Architecture

A large Angular application can be divided into a hierarchy of components.

Root Component
AppComponent
↓
Component
HeaderComponent
Component
StudentComponent
Component
FooterComponent

Structure of an Angular Component

A component generally contains three important parts: the TypeScript class, template, and styles.

TypeScript Class Application logic and data
+
HTML Template User interface
+
CSS Styles Component appearance

Creating a Component

Angular CLI can be used to create a new component quickly.

Angular CLI
ng generate component student

Short form:

Angular CLI
ng g c student

Component Example

The following component contains a student name and displays it through its template.

TypeScript
import { Component } from '@angular/core';

@Component({
    selector: 'app-student',
    templateUrl: './student.component.html'
})
export class StudentComponent {

    studentName = 'Sam';

}

The template can display the component property using interpolation.

HTML
<h2>Student Details</h2>

<p>
    Student Name: {{ studentName }}
</p>
Expected Output

Student Details

Student Name: Sam

Parent and Child Components

Components can have relationships with other components. A parent component can contain one or more child components.

Parent Component StudentComponent
↓
StudentProfile
StudentCourses
StudentResult

Component Communication

Components often need to communicate with each other. Angular provides mechanisms such as Input and Output for parent-child communication.

Parent
↓
@Input
↓
Child
↑
Microsoft.AspNetCore.Mvc.ViewFeatures.Buffers.ViewBufferTextWriter
↑
Parent

Reusable Components

One of the biggest advantages of component-based development is reusability.

A component can be designed once and reused in different parts of an application.

Header

Reusable navigation and branding component.

Button

Reusable button with common styling and behavior.

Student Card

Reusable component for displaying student details.

Login Form

Reusable authentication form component.

Benefits of Component-Based Angular

  • Components are reusable.
  • Applications are easier to organize.
  • Individual components are easier to maintain.
  • Components can be tested independently.
  • Large applications can be divided into smaller parts.
  • Teams can work on different components independently.

Complete Component-Based Flow

AppComponent
↓
StudentComponent
↓
Student Profile
↓
Student Data

Summary

Angular applications are built using reusable and independent components. Components contain application logic, templates, and styles and can communicate with other components.

Component-based development makes Angular applications easier to organize, reuse, maintain, and test. In the next module, we will learn about Angular Setup.