使用angular-cli快速开发
xuwendeMacBook-Pro:angular2 xuwen$ ng new helloangular
installing ng
create .editorconfig
create README.md
create src/app/app.component.css
create src/app/app.component.html
create src/app/app.component.spec.ts
create src/app/app.component.ts
create src/app/app.module.ts
create src/assets/.gitkeep
create src/environments/environment.prod.ts
create src/environments/environment.ts
create src/favicon.ico
create src/index.html
create src/main.ts
create src/polyfills.ts
create src/styles.css
create src/test.ts
create src/tsconfig.app.json
create src/tsconfig.spec.json
create src/typings.d.ts
create .angular-cli.json
create e2e/app.e2e-spec.ts
create e2e/app.po.ts
create e2e/tsconfig.e2e.json
create .gitignore
create karma.conf.js
create package.json
create protractor.conf.js
create tsconfig.json
create tslint.json
Installing packages for tooling via npm.
^C
xuwendeMacBook-Pro:angular2 xuwen$ cd helloangular/
xuwendeMacBook-Pro:helloangular xuwen$ npm install
xuwendeMacBook-Pro:helloangular xuwen$ ng serve
node_modules appears empty, you may need to run `npm install`
xuwendeMacBook-Pro:helloangular xuwen$ ng serve
Port 4200 is already in use. Use '--port' to specify a different port.
xuwendeMacBook-Pro:helloangular xuwen$ ng serve --port 4200
** NG Live Development Server is running on http://localhost:4200 **
Hash: 3f27c8d1544467ceb610
Time: 9389ms
chunk {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 158 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.js.map (main) 3.62 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.js.map (styles) 9.77 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.37 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
^C
xuwendeMacBook-Pro:helloangular xuwen$ ng g m home
installing module
create src/app/home/home.module.ts
xuwendeMacBook-Pro:helloangular xuwen$ ng g m home/HomeRouting --flat
installing module
create src/app/home/home-routing.module.ts
xuwendeMacBook-Pro:helloangular xuwen$ ng g c home/home
installing component
create src/app/home/home/home.component.css
create src/app/home/home/home.component.html
create src/app/home/home/home.component.spec.ts
create src/app/home/home/home.component.ts
update src/app/home/home.module.ts
xuwendeMacBook-Pro:helloangular xuwen$
C
众所周知的原因创建完就无法更新了,所以我们可以从其他的项目中拷贝一份node目录过来,就可以进行下一步了