博文

目前显示的是标签为“CLI”的博文

Angular/CLI stories

1. From: https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/proxy.md We create a file next to projects package.json called proxy.conf.json with the content { " /api " : { " target " : " http://localhost:3000 " , " secure " : false } } You can read more about what options are available here webpack-dev-server proxy settings and then we edit the package.json file's start script to be " start " : " ng serve --proxy-config proxy.conf.json " , now run it with npm start   Ref: https://webpack.github.io/docs/webpack-dev-server.html#proxy  // Multiple entry proxy: [ { context: [ '/api-v1/**' , '/api-v2/**' ], target: 'https://other-server.example.com' , secure: false } ]   import {Http} from '@anuglar/http'; import 'rxjs/Rx' data:any; ngOnInit(){ this.http.get('api/getSrc').map (res=> res.json()).subs...