Questions tagged [hash-location-strategy]
23 questions
51
votes
8 answers
Using HTML anchor link fragment in Angular 6
I am working with an Angular 6 project in which I have disabled/removed hash-location-strategy which removes # from URL.
due to this change the link having:
Contact Settings
…

Suresh Karia
- 17,550
- 18
- 67
- 85
6
votes
1 answer
Navigate to a fragment of a **different** (not the same) page/component in Angular
On click of a link, I would like to navigate to a fragment of a different page/component. I have not been able to achieve this even though trying multiple things:
Link:
View
The destination…

MPP
- 65
- 1
- 7
4
votes
2 answers
Using 'useHash: true' breaks opening of Angular routes in new page
I am trying to open an Angular route in a new tab and am having issues after adding {useHash: true} to the router. It worked fine before trying useHash, opened the tab, and brought me right to the component I wanted. Now it seems that regardless of…

menzelr
- 41
- 1
- 1
- 3
3
votes
1 answer
Cant get Query params in Hashlocation strategy in Angular
I am using a hash location strategy in Angular
routing.module.ts
@NgModule({
imports: [
RouterModule.forRoot(routes, { useHash: true })
],
exports: [
RouterModule
]
})
app.module.ts
@NgModule({
providers: [{ provide:…

Amod Shinde
- 144
- 9
3
votes
0 answers
Angular application can't redirect after OAuth2 login when using HashLocationStrategy
I am working on an existing, in-production Angular 7 application. My task is migrate from a local authentication scheme to an existing company-wide identity provider. The identity provider is compliant with OAuth2. I am using the oidc-client…

Steve H
- 43
- 6
2
votes
1 answer
Handling OAuth2 Implicit Redirect with Angular Routing using HashLocationStrategy
I'm enabling OAuth2 on an SPA as follows:
The implicit grant type is the only grant type supported
My Angular 5 app uses HashLocationStrategy for its routing
I cannot change either of these constraints.
When I log in to my app and get redirected,…

Mark
- 4,970
- 5
- 42
- 66
1
vote
1 answer
How to catch unhashed paths using hashed location strategy?
I've had troubles solving this. We're using HashLocationStrategy in our application and for some cases we will not be changing this. But I have to catch certain paths containing a series of numbers like this:
www.someurl.com/1241234
I have…

Fatih Ersoy
- 680
- 1
- 5
- 24
1
vote
0 answers
Ionic 4 : ionic run browser give cannot get page on refreshing the page
I'm getting cannot get the page on refreshing it while running ionic cordova run browser
but working fine in ionic serve
providers: [
StatusBar,
SplashScreen,
Keyboard,
HttpService,
HTTP,
{ provide: RouteReuseStrategy,…

Nikhil Behera
- 165
- 1
- 9
1
vote
3 answers
Azure OAuth2 fails with Angular HashLocationStrategy
This is a follow up question to Angular App Hosting Azure Storage Container - Azure Authentication Callback and Routing fails.
Summary:
I want to host my Angular 8 app on an Azure Storage Account. To make the routing work I had to turn on the…

MatterOfFact
- 1,253
- 2
- 18
- 49
1
vote
1 answer
Angular 5 avoid HashLocationStrategy for specific route
In my angular 5 application I have multiple routes. I have added { provide: LocationStrategy, useClass: HashLocationStrategy } in providers of app.module.ts file. But I want to remove this HashLocationStrategy from specific route.
Thank you.

Tushar
- 1,948
- 1
- 13
- 32
0
votes
2 answers
Is there any way to safely change LocationStrategy in Angular?
I have an app that uses HashLocationStrategy and I want to change it to PathLocationStrategy. The issue is that I don't want to break existing links (ie bookmarked by users).
The main idea is to receive urls like localhost:3002/#/crisis-center and…

Andreas
- 970
- 18
- 28
0
votes
2 answers
Angular 13 app deployed on apache server throwing 404 Error on refresh
I have created one prototype web app and need to deploy on apache server on ubuntu OS.
I have build my web app and hosted on local machine to run for testing.
I have enabled setup the .htaccess with,
RewriteEngine on
# Don't rewrite files or…

Amey Damle
- 69
- 1
- 6
0
votes
0 answers
Angular 12 Chartjs - Charts only appear on root page - routing issue?
I have a navbar, a sidebar, and a bunch of pages.
The user must login in order to view this.
Charts on the landing page appear perfectly (URL ending '').
Charts on any other page refuse to appear. I have copy-pasted the entire code form the working…

Ree
- 863
- 2
- 18
- 38
0
votes
1 answer
ActiveReportsJS Report Designer Component is affected by HashLocationStrategy in ASP.NET Boilerplate Angular Application
I followed the instruction in https://www.grapecity.com/activereportsjs/docs/GettingStarted/QuickStart-ARJS-Designer-Component/QuickStart-Angular and made some modifications to integrate the ActiveReportsJS Report Designer in the ASP.NET Boilerplate…

Shiraineko
- 5
- 1
0
votes
1 answer
Angular routing working on dev mode but not when starting as spring boot app
I'm new to angular, using angular 10.
In "app-routing.module.ts", i can see below config to enable "#" in url
imports: [ RouterModule.forRoot(routes, { useHash: true }) ]
Problem:
If i'm running application through vs code on dev server(4200 port)…

Devkinandan Chauhan
- 1,785
- 1
- 17
- 42