HashLocationStrategy
// routing
export const routing = RouterModule.forRoot(routes, { useHash: true });
//for enabling production mode, before loading root NgModule,
import { enableProdMode } from '@angular/core';
if (<condition to enable production mode>) {
enableProdMode();
}
4.2
5
import { NgModule } from '@angular/core';import { BrowserModule } from '@angular/platform-browser';import { AppComponent } from './app.component';import { HashLocationStrategy, LocationStrategy } from '@angular/common';@NgModule({ declarations: [AppComponent], imports: [BrowserModule], providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}], bootstrap: [AppComponent],})export class AppModule {}
Thank you!
5
0
Are there any code examples left?
New code examples in category Javascript