Angular: Create a workspace (Serie 1)

Prerequisites

1.1 Node.js

According to the documentation, you need Node.js (>10.9.0) installed on your computer. You can check the Node version with the following command:

node -v.

1.2 npm

We use the npm client command line shipped with Node.js to download and install npm packages.

1.3 Angular CLI

Use the following command to install the Angular CLI globally:

npm install -g @angular/cli

You can find the available command reference here.

Create a workspace and initial app

In order to create a skeleton for an application named my-app, you only need to run the new command as:

ng new my-app

The new command prompts you to select the routing mode, the style mode (css, scss...).

Create a workspace under an existing folder

For creating a workspace under an existing folder, do the following:

  1. open a terminal on your current folder (e.g. my-app)
  2. Run the following command : ng new my-app --directory=./

Run your app

In order to build and serve your app locally, Angular CLI is shipped with a development server.

Run the following command to open your app:

cd my-app
ng serve --open

The --open option indicates to open the app in your default browser.

Comments

Popular posts from this blog

Spring JPA : Using Specification with Projection

Chip input using Reactive Form