CLI命令
npm install -g @angular/cling new my-project-nameng serve --open-
创建组件
ng generate component heroesng generate component banner --inline-template --inline-style --module app
在 app/banner 文件夹中生成带有内联模板和内联样式的 BannerComponent
--flat 把这个文件放进了 src/app 中,而不是单独的目录中。--module=app 告诉 CLI 把它注册到 AppModule 的 imports 数组中。
创建路由
ng generate module my-module --routing
添加ng-zorro
ng add ng-zorro-antd
指令
ng-container
反向代理 proxy.conf.json
注意要有changeOrigin
{"/pictures": {"target": "http://api.soomey.net/pictures-v21","secure": false,"logLevel": "debug","pathRewrite": {"^/pictures" : ""},"changeOrigin": true}}
