Skip to content

Getting Started!

Chapter Objectives

  • βœ”οΈ
    Generate an Angular application
    Learn how to use the Angular CLI to generate an Angular application.

  • βœ”οΈ
    Run the application
    Launch the application locally and view the default base page.

  • βœ”οΈ
    Understand hot reloading
    Understand how hot reloading works in Angular applications.

Create the project

Angular provides a Command Line Interface (CLI) to generate a new Angular application, manage the project, and run the application locally.

πŸŽ“ Instructions

  1. Open a terminal and run the following command to create an Angular application:

    Terminal window
    npm create @angular/cli@17.0.0 angular-introduction-course --standalone=false --style=css --ssr=false --skip-tests=true

Open the project

πŸŽ“ Instructions

  1. Open Visual Studio Code. 2. Click on the File menu and select Open Folder. 3. Navigate to the angular-introduction-course folder and click the Select Folder button.

Run the application

The Angular CLI provides a command to launch the application locally.

πŸŽ“ Instructions

  1. Open Visual Studio Code’s terminal.

  2. Type the following command to start the application:

    Terminal window
    ng serve
  3. Open your browser and navigate to http://localhost:4200.

  4. You should see the following default base page:

    A bird sitting on a nest of eggs.

Hot Reloading

Hot reloading is a feature that allows you to see the changes you make to your code without having to manually refresh the page.

πŸŽ“ Instructions

  1. Open the src/app/app.component.html file.

  2. Replace the entire content of the file with the following code:

    app.component.html
    <header>
    <h1>Angular Legacy course</h1>
    </header>
  3. Return to your browser to see the following page:

    A bird sitting on a nest of eggs.