Angular2 2017-04-19

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
  • All generate commend
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
  • Updating Angular Cli
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容