1. 资料汇总
在线例子
思维导图
2. Angular2 cli commend line interface
angular cli github
wiki
- Generating Components, Directives, Pipes and Services . eg:
ng generate component my-new-component
ng g component my-new-component # using the alias
# components support relative path generation
# if in the directory src/app/feature/ and you run
ng g component new-cmp
# your component will be generated in src/app/feature/new-cmp
# but if you were to run
ng g component ../newer-cmp
# your component will be generated in src/app/newer-cmp
Scaffold |
Usage |
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 |
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest
网友评论