• 概要
@angular/router

withHashLocation

function
stable

Provides the location strategy that uses the URL fragment instead of the history API.

API

function withHashLocation(): RouterHashLocationFeature;

withHashLocation

Provides the location strategy that uses the URL fragment instead of the history API.

Usage Notes

Basic example of how you can use the hash location option:

          
const appRoutes: Routes = [];bootstrapApplication(AppComponent,  {    providers: [      provideRouter(appRoutes, withHashLocation())    ]  });
Jump to details