Angular2 高级种子工程
github地址:https://github.com/linweiwei123/hotshots-admin-angular2
种子工程 拿来即用;
1 良好的工程结构;
1.1 header,导航栏做通用component独立出来;
1.2 输出文件分门别类
2 angular2+webpack1构建;
2.1 编译文件分类输出;
2.2 输出js放index.html顶部加defer;
2.3 webpack loader处理css,fonts,img案例;
3 模块高级使用;
3.1 特性模块
3.2 lazyload,code splitting;
3.3 共享模块;
3.4 多级router-outlet
4 路由高级使用;
4.1 转场动画
4.2 相对路由
4.3 必须参数和不定参数
5 service简单使用;
数据持久化到内存;
6 404页面;
处理未匹配的url案例
7 外部CSS;
多个css外部文件的关系处理;
高级模块使用 路由高级使用 404页面2016-12-8新增内容
8 路由守护
增加路由守护9 结合JWT做权限控制,增加登陆页面;
登陆页面10 form表单验证
登陆页面就是一个最好的表单验证
网友评论
Html Webpack Plugin:
Error: Child compilation failed:
Loader H:\javascripts\hotshots-admin-angular2\node_modules\html\lib\html.js di dn't return a function
- compiler.js:78
[hotshots-admin-angular2]/[html-webpack-plugin]/lib/compiler.js:78:16
- Compiler.js:214 Compiler.
[hotshots-admin-angular2]/[webpack]/lib/Compiler.js:214:10
- Compiler.js:403
[hotshots-admin-angular2]/[webpack]/lib/Compiler.js:403:12
- Tapable.js:67 Compiler.next
[hotshots-admin-angular2]/[tapable]/lib/Tapable.js:67:11
- CachePlugin.js:40 Compiler.
[hotshots-admin-angular2]/[webpack]/lib/CachePlugin.js:40:4
- Tapable.js:71 Compiler.applyPluginsAsync
[hotshots-admin-angular2]/[tapable]/lib/Tapable.js:71:13
- Compiler.js:400 Compiler.
[hotshots-admin-angular2]/[webpack]/lib/Compiler.js:400:9
- Compilation.js:577 Compilation.
[hotshots-admin-angular2]/[webpack]/lib/Compilation.js:577:13
- Tapable.js:60 Compilation.applyPluginsAsync
[hotshots-admin-angular2]/[tapable]/lib/Tapable.js:60:69
- Compilation.js:572 Compilation.
[hotshots-admin-angular2]/[webpack]/lib/Compilation.js:572:10
- Tapable.js:60 Compilation.applyPluginsAsync
[hotshots-admin-angular2]/[tapable]/lib/Tapable.js:60:69
- Compilation.js:567 Compilation.
[hotshots-admin-angular2]/[webpack]/lib/Compilation.js:567:9
- Tapable.js:60 Compilation.applyPluginsAsync
[hotshots-admin-angular2]/[tapable]/lib/Tapable.js:60:69
- Compilation.js:563 Compilation.
[hotshots-admin-angular2]/[webpack]/lib/Compilation.js:563:8
- Tapable.js:60 Compilation.applyPluginsAsync
[hotshots-admin-angular2]/[tapable]/lib/Tapable.js:60:69
- Compilation.js:525 Compilation.seal
[hotshots-admin-angular2]/[webpack]/lib/Compilation.js:525:7
16 verbose cwd D:\master
17 error Windows_NT 6.1.7601
18 error argv "E:\\SoftWare\\Program Files\\node.js\\node.exe" "E:\\SoftWare\\Program Files\\node.js\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 error node v6.9.1
20 error npm v3.10.8
21 error code ELIFECYCLE
22 error angular2-boilerplate-lww@1.0.0 start: `webpack-dev-server --inline --progress --profile --port 3000`
22 error Exit status 1
23 error Failed at the angular2-boilerplate-lww@1.0.0 start script 'webpack-dev-server --inline --progress --profile --port 3000'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the angular2-boilerplate-lww package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error webpack-dev-server --inline --progress --profile --port 3000
23 error You can get information on how to open an issue for this project with:
23 error npm bugs angular2-boilerplate-lww
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls angular2-boilerplate-lww
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]