xxxxxxxxxx
//You have to add { useHash: true } in your router module
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { ROUTES } from './app.routes';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule],
RouterModule.forRoot(ROUTES ,{ useHash: true }),],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
xxxxxxxxxx
Use HashLocation strategy.
Add to top level module
import { HashLocationStrategy, LocationStrategy } from '@angular/common';
providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}],