I have an angular application uses routing with HashLocationStrategy, I need to set different value in main html file and different in routing.
I tried this solution:
@NgModule({
imports: [
BrowserModule,
FormsModule,
HttpModule,
MyRouting // with useHash set to true
],
declarations: [
AppComponent,
],
providers: [
{ provide: APP_BASE_HREF, useValue: '/prefix' }
],
bootstrap: [AppComponent]
})
export class AppModule { }
Works almost well but value '/prefix' is insert after hash, like this:
http://myapp.com/#/prefix/home
Whereas i want:
http://myapp.com/prefix/#/home
For clarity, my base tag is:
<base href="/">