Skip to content

Your First Angular Application

Use the Angular CLI to create and serve a new project:

  1. 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:

Terminal window
cd my-first-app
  1. Serve the application

    Terminal window
    ng serve

Open http://localhost:4200 in your browser. The default app is already running.

  1. Modify the app component – open src/app/app.component.ts and 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.