angular-webpack

The template specified for component AppComponent is not a string - Angular 7-8

自闭症网瘾萝莉.ら 提交于 2020-01-16 19:07:57
问题 disclaimer: Yes, I saw that there are more "The template specified for component AppComponent is not a string" related questions but none of them describes the specific problem I'm experiencing. I get this runtime error when I compile without AoT in ng build : Uncaught Error: The template specified for component AppComponent is not a string This error actually make sense because in the generated bundled code (main.ts) I see: template: __webpack_require__(/*! raw-loader!./app.component.html */

The template specified for component AppComponent is not a string - Angular 7-8

不打扰是莪最后的温柔 提交于 2020-01-16 19:05:30
问题 disclaimer: Yes, I saw that there are more "The template specified for component AppComponent is not a string" related questions but none of them describes the specific problem I'm experiencing. I get this runtime error when I compile without AoT in ng build : Uncaught Error: The template specified for component AppComponent is not a string This error actually make sense because in the generated bundled code (main.ts) I see: template: __webpack_require__(/*! raw-loader!./app.component.html */

Angular CLI: Change REST API URL on build

允我心安 提交于 2019-12-31 12:15:07
问题 I want to remove my local server prefix from my REST API URLs (example, http://localhost:8080) when building for production ( ng build --prod ). I get that it's something to do with the environment file environment.prod.ts , but can't find any examples of making use of them to achieve the aforementioned. Would be great if someone helps me get started! 回答1: Dont hard code the URL. Use environment.prod.ts and environment.ts files which are inside src/environments. for localhost, in environment