This document provides a step-by-step guide to getting started with an Angular project. It covers setting up the project, starting the development server, and other essential tasks.
Before you begin, ensure that you have the following installed:
-
Node.js and npm (Node Package Manager)
-
Angular CLI (Command Line Interface)
-
Open your terminal or command prompt.
-
Create a new Angular project by running the following command:
ng new my-angular-project
-
Navigate into the newly created project directory:
cd my-angular-project
To start the development server and view your Angular application in the browser, follow these steps:
-
Run the following command to start the development server:
ng serve
-
Once the server is up and running, open your web browser and navigate to
http://localhost:4200/
.
Here are some additional commands that you may find useful while working on your Angular project:
-
ng generate component <component-name>
- Generate a new component. -
ng generate service <service-name>
- Generate a new service. -
ng build
- Build the project for production. -
ng test
- Run unit tests. -
ng lint
- Lint the project files.
Congratulations! You’ve successfully set up an Angular project and started the development server. You can now begin building your Angular application.
For more information and advanced topics, refer to the official Angular documentation at https://angular.io/.