Angular CLI 是 Angular 开发的官方工具,用于快速创建和管理项目。以下是关键使用指南:
1. Installation 🚀
Install Angular CLI globally using npm:
npm install -g @angular/cli
2. Common Commands 📋
ng new <project_name>
: Create a new projectng generate component <name>
: Generate a new componentng serve
: Start a development serverng build
: Build the project for productionng test
: Run unit tests
3. Project Structure 📁
A typical Angular CLI project includes:
angular.json
: Configuration filesrc/
: Source code directorypackage.json
: Dependencies and scripts
4. Expand Your Knowledge 📚
For deeper insights, check our Angular Quickstart Guide to learn how to set up your first Angular application.
Let me know if you need further assistance! 😊