快速创建项目:
- npm install -g @angular/cli
- ng new PROJECT-NAME
- cd PROJECT-NAME
- cnpm install
- ng serve
- ng build
//ng build --aot
//ng build --prod
添加新 Components、Services...
Component
ng g component my-new-component
Directive
ng g directive my-new-directive
Pipe
ng g pipe my-new-pipe
Service
ng g service my-new-service
Class
ng g class my-new-class
Guard
ng g guard my-new-guard
Interface
ng g interface my-new-interface
Enum
ng g enum my-new-enum
Module
ng g module my-module
网友评论