Then install the Angular CLI globally.
1 |
npm install -g @angular/cli |
Step 2. Create a new project
Open a terminal window.
Generate a new project and default app by running the following command:
1 |
ng new my-app |
The Angular CLI installs the necessary npm packages, creates the project files, and populates the project with a simple default app. This can take some time.
Step 3: Serve the application
Go to the project directory and launch the server.
1 2 |
cd my-app ng serve --open |
The ng serve
command launches the server, watches your files, and rebuilds the app as you make changes to those files.
Using the --open
(or just -o
) option will automatically open your browser on http://localhost:4200/
.
Leave a reply