美文网首页
Angular2 2017-04-19

Angular2 2017-04-19

作者: Hafei | 来源:发表于2017-04-19 14:50 被阅读15次

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

相关文章

网友评论

      本文标题:Angular2 2017-04-19

      本文链接:https://www.haomeiwen.com/subject/tceczttx.html