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

Creating an Angular Application

After installing Node.js and Angular CLI, we can create our first Angular application using the Angular CLI.

What is an Angular Application?

An Angular application is a web application built using the Angular framework. Angular provides components, templates, services, routing, forms and other features required to develop modern web applications.

Angular CLI provides the ng new command to create a new Angular application with the required project structure.

In Simple Words

The ng new command creates a ready-to-use Angular project with the required files, folders and configuration.

Angular Application Creation Flow

1

Open Terminal

Open Command Prompt or Terminal.

→
2

Run ng new

Create a new Angular project.

→
3

Configure

Select project configuration options.

→
4

Project Ready

Angular creates the project files.

Step 1: Open Terminal

Open Command Prompt, PowerShell or Terminal on your computer.

Tip: You can open the terminal from any folder where you want to create your Angular project.

Step 2: Create a New Angular Application

Use the following command to create a new Angular application:

Terminal
ng new CIITStudentApp
Expected Result

Angular CLI starts the project creation process and asks for the required project configuration options.

Understanding the Project Name

In the command:

Command
ng new CIITStudentApp
ng Angular CLI command
new Create a new Angular application
CIITStudentApp Name of the Angular application

Step 3: Angular Project Configuration

During project creation, Angular CLI may ask configuration questions depending on the Angular version and project setup.

01
Stylesheet Configuration

Select the stylesheet format required by the project.

02
Routing

Configure routing when the application requires multiple pages or routes.

03
Additional Configuration

Select additional options according to the project requirements.

Step 4: Angular Creates the Project

After the configuration is completed, Angular CLI creates the application folder and generates the required project files.

Terminal
CREATE CIITStudentApp/
CREATE CIITStudentApp/src/
CREATE CIITStudentApp/src/app/
CREATE CIITStudentApp/angular.json
CREATE CIITStudentApp/package.json
Expected Result

A new Angular project named CIITStudentApp is created successfully.

Step 5: Move Into the Project Folder

After creating the application, move into the project folder using the cd command.

Terminal
cd CIITStudentApp

Why use cd?

The cd command changes the current directory to the Angular project folder.

Step 6: Run the Angular Application

Start the Angular development server using:

Terminal
ng serve
Expected Output

Angular starts the development server and provides a local URL for opening the application.

http://localhost:4200

Angular Application Running Flow

CIITStudentApp Angular Project
↓
ng serve Development Server
↓
localhost:4200 Local Application URL
↓
Browser Angular Application UI

Basic Angular Project Structure

After creating the application, Angular CLI generates a structured project containing configuration files, source files and application files.

CIITStudentApp
│
├── src
│   ├── app
│   ├── assets
│   ├── index.html
│   └── main.ts
│
├── angular.json
├── package.json
├── tsconfig.json
└── README.md
Note: The exact files and structure can vary between Angular versions and project configurations.

Complete Angular Application Creation

1 Install Node.js
→
2 Install Angular CLI
→
3 ng new
→
4 Configure
→
5 ng serve

Common Issues

'ng' is not recognized

Make sure Angular CLI is installed correctly and restart the terminal before trying again.

Project Name Error

Use a valid project name without spaces or unsupported characters.

Port Already in Use

If the default development port is already being used, Angular CLI can use another available port.

Summary

Angular CLI provides the ng new command for creating a new Angular application.

The basic process is ng new → Configure Project → Create Files → cd Project → ng serve .

After starting the development server, the application can be opened using http://localhost:4200.

In the next topic, we will learn about Angular Project Structure.