I want to build and deploy my Angular 2 front end to a Tomcat application server. For getting started I\'ve followed exactly the steps of the following introduction: https:/
The problem is related to the tag . This is just wrong when using a webserver like tomcat or trying to load the app directly from filesystem with firefox index.html. This must be changed to . When the app still has problems check how the script files are imported. I tried to use angular2-webpack with tomcat and also needed to change all script tags to not use a leading slash in there src attribute.
With webpack the behavior is controlled by the attribute output.publicPath. In the angular2 documentation and in the angular2-webpack this is set to
output.publicPath="/"
Which leads to absolute path in the links. When removed webpack will use relative paths and the links for scripts and images work.