Before installing Angular, ensure you have the following installed:
Angular requires Node.js and npm (Node Package Manager) to run. Download and install them from:
π https://nodejs.org
To check if Node.js and npm are installed, run:
node -v
npm -v
Angular CLI (Command Line Interface) simplifies project creation and management.
Run the following command in the terminal:
npm install -g @angular/cli
Verify installation:
ng version
Run the following command:
ng new my-angular-app
πΉ What This Command Does:
βοΈ Creates a new project folder with all necessary Angular files
βοΈ Installs required dependencies
βοΈ Sets up TypeScript and other configurations
Navigate to the project directory:
cd my-angular-app
Run the following command:
ng serve
πΉ Open http://localhost:4200/ in your browser.
You should see the default Angular Welcome Page! π
After installation, the project folder contains:
π src/ – Main project source code
π app/ – Contains Angular components
π assets/ – Stores images and other static files
π environments/ – Configuration for different environments
π angular.json – Angular project configuration
π package.json – Project dependencies and scripts
Angular supports various dependencies like Bootstrap, Material UI, and RxJS.
Example: Install Bootstrap
npm install bootstrap
By following these steps, you have successfully:
βοΈ Installed Node.js and npm
βοΈ Installed Angular CLI
βοΈ Created a new Angular project
βοΈ Started the development server