Angular CLI | Angular Project Setup (original) (raw)

Last Updated : 06 Sep, 2024

Angular is an open-source front-end web application framework that is used for building single-page and complex web applications. By default, angular uses TypeScript for creating logic but as the browser doesn't know typescript it converts typescript into javascript in order to make typescript understandable.

What is Angular CLI?

Angular CLI (Command Line Interface) is a powerful tool for managing Angular Projects. It is a handy tool that makes building Angular apps easier and faster. It makes the development process easier by defining different commands for different operations. It keeps your project organized and consistent.

**Note: Please make sure you have installed node and npm in your system. You can check your node version and npm version by using the following command:

node --version
npm --version

Screenshot-2024-09-05-122901

Nodejs and NPM version

**Steps To Create Application Using Angular CLI

**Step 1: Install Angular CLI

npm install - g @angular/cli

Screenshot-2024-09-05-123117

Installation of Angular CLI

**Step 2: Create new Project

ng new myNewApp

Ng-NewApp

Angular project Creation

**Step 3: Navigate to your Project Directory

cd myNewApp

Screenshot-2024-09-05-124535

Project Directory Navigation

**Step 4: Run Server and See Your Application

ng serve

Screenshot-2024-09-05-124725

Command to start the server

**Output

Screenshot-2024-09-05-124827

Angular Project Setup

**Folder Structure:

Screenshot-2024-09-05-125055

Folder Structure

**src/ Folder: This is the main directory where all your application code exists. It contains everything necessary for building and running your app.

**Other files which are mostly used:

As a beginner you don't need these files at this time, don't bother about that. These all are used for editor configurations and information needed at compile time. The builtin webpack in angular CLI manages all for you.

For more reference, you can refer our article on Folder Structure of Angular.

**More commands that you will need while working on the project:

ng generate component component_name
ng generate service service_name
ng generate directive directive_name