Angular > 🧑💻 Exercise 03
🚀 Your First Angular App
Getting Started with Your First Angular App in 4 simple steps
🛠️ Prerequisites
- Node JS
- NPM (comes along with Node.js)
📦 Step 1: Install Angular CLI
The Angular CLI helps scaffold and manage Angular apps with ease.
npm install -g @angular/cli
To check if it installed correctly:
ng version
✨ Step 2: Create a New Angular Project
Use the CLI to create a new project (replace my-first-app with your preferred name):
ng new my-first-app
During Setup:
- Choose No for routing (or Yes if you need it).
- Select CSS or your preferred stylesheet format.
This will install dependencies and scaffold the app.
🚀 Step 3: Run the Angular App (Development Server)
Navigate to the project folder:
cd my-first-app
Start the development server:
ng serve
Open your browser and visit:
http://localhost:4200
You should see the default Angular welcome page.
🧩 Step 4: Change the Default Page Content
-
Open your project in VS Code or any code editor.
-
Navigate to:
src/app/app.component.html
- Replace the contents with:
<h1>Welcome to My First Angular App!</h1>
<p>This is a custom homepage 🎉</p>