Your First Angular Application
Use the Angular CLI to create and serve a new project:
-
Create a new workspace and initial application
ng new my-first-app
The CLI will prompt you for options (choose defaults or enable SSR/SSG if desired).
Once created, navigate into the folder:
cd my-first-app-
Serve the application
Terminal window ng serve
Open http://localhost:4200 in your browser. The default app is already running.
-
Modify the app component – open
src/app/app.component.tsand change the template:import { Component } from "@angular/core";@Component({selector: "app-root",standalone: true,template: `<h1>Hello, Angular!</h1><p>My first app works!</p>`,})export class AppComponent {}
The browser will automatically reload with your changes.