Incorrect Asset folder resources path when deployed inside war
Versions.
@angular/cli: 1.0.0-rc.4 node: 7.2.0 os: win32 x64 @angular/common: 2.4.10 @angular/compiler: 2.4.10 @angular/core: 2.4.10 @angular/forms: 2.4.10 @angular/http: 2.4.10 @angular/platform-browser: 2.4.10 @angular/platform-browser-dynamic: 2.4.10 @angular/router: 3.4.10 @angular/cli: 1.0.0-rc.4 @angular/compiler-cli: 2.4.10
I have deployed Angular 2 inside War file in tomcat. I have changed base href to "/AngularSpring" in index.html.
using command : ng build --prod --aot=false -bh /AngularSpring -d /AngularSpring
http://localhost:8080/AngularSpring/---- . Application URL.
The application is loading fine but resources which are inside asset folder gives 404. http://localhost:8080/assets/env.json 404. Following line in TS file is giving issue at runtime this.getConfigFile('./assets/env.json');
Is there any way which automatically appends ./AngularSpring before the './assets/env.json as inside war file asset folder in inside /AngularSpring.
please help I have N number of the solution but none of them worked. I don't want to change the path in the file manually.
getConfigFile is a method to dynamically the file at runtime, right? The CLI itself doesn't do anything about those, but there might be a way to figure out the base url on an app at runtime.
Yes, that way I am searching for but not able to find any.
Heya, there haven't been any other answers here so I'm closing this issue. Stack Overflow would be a good place to ask as well.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.