📅  最后修改于: 2023-12-03 15:03:10.413000             🧑  作者: Mango
The Angular CLI (Command Line Interface) provides a convenient way to create new Angular applications. One of the most common ways to create a new app is by using the ng new
command. In this article, we will look at how to create a new Angular application using the ng new
command in a Shell-Bash environment.
Before we start creating a new Angular application, make sure you have the following software installed on your system:
Open your preferred terminal (e.g., Command Prompt, PowerShell, Terminal, etc.) and navigate to the directory where you want to create your new Angular application.
Run the following command in your terminal:
ng new app
This command creates a new Angular application with the name app
. You can replace app
with the name of your choice.
$ ng new app
When prompted, select the default options for your new Angular application such as the stylesheet format (CSS, SCSS, SASS, etc.).
Wait for the CLI to create your new Angular application. This may take a few minutes depending on your internet speed and system configuration.
Once the process is complete, navigate to the newly created application directory:
cd app
$ cd app
Finally, start the Angular development server by running the following command:
ng serve --open
This command starts the development server and opens the application in your default web browser. You can now start building and testing your Angular application.
$ ng serve --open
Congratulations! You have successfully created a new Angular application using the ng new
command in a Shell-Bash environment. You can now start building amazing applications using Angular.