You can also use hash-based navigation by including the following in app.module.ts
import { LocationStrategy, HashLocationStrategy } from '@angular/common';
and by adding the following to the @NgModule({ ... })
@NgModule({
...
providers: [
ProductService, {
provide: LocationStrategy, useClass: HashLocationStrategy
}
],
...
})
“HashLocationStrategy—A hash sign (#) is added to the URL, and the URL segment after the hash uniquely identifies the route to be used as a web page fragment. This strategy works with all browsers, including the old ones.”
Excerpt From: Yakov Fain Anton Moiseev. “Angular 2 Development with TypeScript.”