angular cli wiki home文件 - Christian-Yang/Translate-and-save GitHub Wiki
Home 首页
Angular CLI
Overview
概述
The Angular CLI is a tool to initialize, develop, scaffold and maintain Angular applications
Angular CLI是初始化,开发,支持和维护Angular应用程序的工具
Getting Started
入门
To install the Angular CLI:
要安装Angular CLI:
npm install -g @angular/cli
Generating and serving an Angular project via a development server Create and run a new project:
通过开发服务器生成和提供Angular项目创建并运行一个新项目:
ng new my-project
cd new-project
ng serve
Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
导航到http//localhost:4200/。 如果您更改任何源文件,应用程序将自动重新加载。
Bundling
捆绑
All builds make use of bundling, and using the --prod flag in ng build --prod or ng serve --prod will also make use of uglifying and tree-shaking functionality.
所有构建都使用捆绑,并且在ng build --prod或ng serve --prod中使用--prod标志也将利用丑化和树形抖动功能。
【uglifying功能是什么? tree-shaking功能是什么?】
Running unit tests
运行单元测试
ng test
Tests will execute after a build is executed via Karma, and it will automatically watch your files for changes. You can run tests a single time via --watch=false or --single-run.
一个karma构建执行之后,test测试才会被执行。并且它将会自动的监视你的文件改变。您可以通过--watch = false或--single-run单次运行测试
Running end-to-end tests
运行端到端的测试
ng e2e
Before running the tests make sure you are serving the app via ng serve. End-to-end tests are run via Protractor.
运行测试之前,请确保您通过ng serve运行应用。 端到端测试通过Protractor(量角器)运行
Additional Commands:附加命令
ng new
ng serve
ng generate
ng test
ng e2e
ng build
ng get/ng set
ng docs
ng eject
(注意上面的每一个都是一个连接可以点击)
Additional Information:附加信息
There are several stories which will walk you through setting up additional aspects of Angular applciations.
有几个故事,将引导您设置Angular应用程序的其他方面。(注意stories是一个连接可以点击)