How to start new angular project
Here are the steps to start a new Angular project:
Method 1: Using the Angular CLI
-
Install the Angular CLI globally by running the following command in your terminal:
npm install -g @angular/cli
-
Create a new Angular project by running the following command:
ng new my-app
Replace
my-app
with the name of your project. -
Follow the prompts to choose the project template and configuration options.
Method 2: Using the Angular CLI with a specific template
- Install the Angular CLI globally by running the following command in your terminal:
npm install -g @angular/cli
- Create a new Angular project with a specific template by running the following command:
ng new my-app --template=blank
Replace
my-app
with the name of your project andblank
with the template name (e.g.,blank
,routing
,full
).
Method 3: Using a code editor or IDE
- Open your preferred code editor or IDE (e.g., Visual Studio Code, IntelliJ IDEA, WebStorm).
- Create a new project by selecting the "Angular" or "Angular CLI" template.
- Choose the project name, location, and configuration options.
Common configuration options
When creating a new Angular project, you'll be prompted to choose the following configuration options:
- Project name: The name of your project.
- Project location: The location where your project will be created.
- Package manager: The package manager to use (e.g., npm, yarn).
- Routing: Whether to include routing in your project.
- SCSS: Whether to use SCSS (Sass) instead of CSS.
- Jest: Whether to use Jest as the testing framework.
Next steps
After creating your new Angular project, you can:
- Explore the project structure and files.
- Run
ng serve
to start the development server and view your project in the browser. - Start building your application by creating components, services, and other features.
- Use the Angular CLI to generate new components, services, and other files.