Angular / New Project
This documentation describes how to create a new Angular project, otherwise known as an Angular application. Before moving forward with the steps below, ensure the Angular CLI has been properly installed.
Create a Workspace and Initial Application
To create a new workspace and initial starter application:
-
Run the CLI command
ng new
and provide the name of the application. In this casemy-angular-app
, for example:ng new my-angular-app
-
The
ng new
command prompts for information about features to include in the initial app. Accept the default by pressing theEnter
orReturn
key.
The Angular CLI installs the necessary Angular npm packages and other dependencies. This can take a few minutes. Angular CLI creates a new workspace and a simple Welcome application, ready to run. See below for instructions on how to run an Angular application on a local server in the browser.
Run the Application
-
To run the application, first navigate to the directory for the application:
cd my-angular-app
-
Launch the server by using the Angular CLI command
ng serve
. The--open
(or just-o
) option automatically opens the default web browser to http://localhost:4200/. Without the--open
option, it is necessary to manually open a web browser page using address http://localhost:4200/.ng serve --open
Next Steps
The documentation found in the following sections will cover concepts in editing an Angular application to fit the needs of a custom web page as well as cover important topics in the design of Angular applications.