English translation
Setting Up the Development Environment and Creating Your First Angular Project
AI Article Decision Snapshot
Turn the lesson into workflow, model, budget, and security checks before choosing tools.
Use this quick snapshot before leaving the article. It keeps the next search tied to practical AI software, model/API, cost, privacy, and implementation questions.
Workflow fit
Identify the real job behind the article: coding, research, document review, support, analytics, content, or internal automation.
Model or tool decision
Decide whether the next step is a software shortlist, an AI tool comparison, an API platform choice, or a model benchmark.
Budget and usage signal
Estimate seats, API calls, prompt volume, retries, review time, and fallback work before assuming the workflow is cheap.
Security and privacy review
Check whether source code, customer data, private documents, prompts, logs, or embeddings will enter the AI workflow.
In the previous chapter, we completed the installation of the Angular CLI, laying the foundation for creating our first project. Now, we’ll create our first Angular application and explore its directory structure and basic configuration.
Creating an Angular Project
Creating a new Angular project with the Angular CLI is straightforward. Simply run the following command in your terminal:
ng new my-angular-app
Here, my-angular-app is the name of your project—you may replace it with any name that suits your needs.
Command Breakdown
ng: The Angular CLI’s command-line interface tool.new: Instructs the CLI to generate a new project.my-angular-app: The name of the new project—freely customizable.
Configuration Options During Project Creation
As the CLI sets up your project, it will prompt you to make several configuration choices:
- Add Angular routing?
Choose “Y” if your application requires multiple views and navigation between them via routing. - Choose a stylesheet format:
The CLI supports multiple CSS preprocessor formats: CSS, SCSS, SASS, LESS, and Stylus. Select the one best suited to your project.
You’ll likely see prompts like these:
? Would you like to add Angular routing? (y/N)
? Which stylesheet format would you like to use? (CSS, SCSS, SASS, LESS, Stylus)
Project Structure
Once created, the CLI generates a new directory containing numerous files and subdirectories. Its foundational structure looks like this:
my-angular-app/
├── e2e/ # End-to-end test files
├── node_modules/ # npm dependency packages
├── src/ # Source code
│ ├── app/ # Application-level code
│ ├── assets/ # Static assets (e.g., images, fonts)
│ ├── environments/ # Environment-specific configuration files
│ ├── index.html # Main HTML entry point
│ ├── main.ts # Bootstrapping entry file
│ ├── polyfills.ts # Browser compatibility shims
│ ├── styles.css # Global styles
│ └── test.ts # Unit test configuration
├── angular.json # Angular workspace and build configuration
├── package.json # npm package metadata and scripts
└── tsconfig.json # TypeScript compiler configuration
Launching the Development Server
Now, let’s start the local development server to view your newly created Angular application. Run the following commands in your terminal:
cd my-angular-app
ng serve
By default, the development server runs at http://localhost:4200. Open your browser and navigate to that address—you’ll see Angular’s welcome page.
Accessing Your Project
Visit http://localhost:4200 in your browser. If everything is set up correctly, you’ll see:
Welcome to my-angular-app!
This confirms your Angular project has been successfully created and is running.
Summary of This Section
In this chapter, we learned how to use the Angular CLI to scaffold a new Angular project, explored its fundamental directory layout, and launched the development server. You now have a working Angular application ready for further development.
In upcoming chapters, we’ll dive deep into Angular’s core building blocks—components—and learn how to create and use them effectively.
Before moving forward, please verify that your project runs successfully—this ensures a solid foundation for subsequent learning. Next, we’ll explore Angular’s cornerstone concept: components—how to create, configure, and integrate them.
Apply This Lesson
Turn this article into AI software, model, API, and security decisions.
English Article FAQ
Use this article as evidence before choosing AI tools
How should I use this AI Tutorials article?
Use it as the implementation or learning layer, then connect the idea to AI software buyer guides, tool comparisons, benchmarks, API choices, and security checks before making a production decision.
Is this English article different from the Chinese original?
The English edition is localized for global AI readers while preserving the original diagrams, screenshots, prompts, code examples, and source context from the Chinese article.
What should I read after Setting Up the Development Environment and Creating Your First Angular Project?
Continue with AI Software Buyer Guides, AI Tools Workbench, Best AI Coding Agents, AI Model Benchmarks, OpenAI vs Anthropic API, or LLM Security Tools depending on the decision you need to make.
Can this article alone choose an AI product or model?
No. Treat the article as evidence and context, then validate fit with pricing, privacy requirements, integration effort, benchmark results, workflow tests, and fallback planning.
Continue