Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

location.hash = "myhash" coming as #/myhash in url #11125

Closed
softreigns opened this issue Feb 21, 2015 · 2 comments
Closed

location.hash = "myhash" coming as #/myhash in url #11125

softreigns opened this issue Feb 21, 2015 · 2 comments

Comments

@softreigns
Copy link

I am having a html page with a angular with angular controller in seperate file. I am bootstrapping in this html page and i have other plain javascript also where I am trying to set the location.hash with a button click. For me hash value in the page url is coming as #/myhash. If i remove angular bootstraping it come correct as #myash. Is there any way to prevent it ? Am I missing something ? Why is bootstrapping making it wrong ?

Thanks for the help

@pkozlowski-opensource
Copy link
Member

This is duplicate of #4608

What is going on here is that the built-in $location service observes URLs and tries to use them for routing. This is exactly what we want in SPAs but usually not what we want in an application which already manages URLs and want to use AngularJS only for a small portion of the page.

There are some work-arounds in #4608 but no "best & official" solution. I hope to look into it in the 1.5 timeframe.

Closing as a duplicate.

@softreigns
Copy link
Author

Thanks for your reply.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants