My Angular2 app is deployed in a sub-directory of a website on IIS. I use the following command to build it. (--bh sets the sub-directory as the root for the app):
ng build --bh testdna --no-aot --dev
I then use routing with in the app as follows
app.routes.ts:
import { Routes } from '@angular/router';
import { DnaPlotComponent } from './dna-plot/dna-plot.component';
export const routes: Routes = [{ path: '', component: DnaPlotComponent }];
app.module.ts:
import { RouterModule } from '@angular/router';
import { routes } from './app.routes';
...
RouterModule.forRoot(routes)
Every time the page is refreshed the URL has the sub-directory appended to it. This means the URL grows infinitely and fails to refresh, resulting in a 404. Here is an example of what I am seeing.
https://develop.domain.com/dnaplot/dnaplot#/dnaplot/
The original URL called is:
https://develop.domain.com/dnaplot
Any ideas to stop this happening would be greatly appreciated.