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

Hashbang routing - Enter site at root path ("/") #5650

Closed
TheSharpieOne opened this issue Jan 6, 2014 · 1 comment
Closed

Hashbang routing - Enter site at root path ("/") #5650

TheSharpieOne opened this issue Jan 6, 2014 · 1 comment

Comments

@TheSharpieOne
Copy link

Angular version: 1.2.7
Browsers affected: All (?)

When html5Mode is false and the url is at the root (mysite.com or mysite.com/) the hash does not get added, the path and url in $location are "" when they should be "/". manually adding the hash (entering mysite.com/#/ specifically) will correct this problem, but you should not require people to enter the hash to enter the site.

angular-hash-problem

What should happen is the url mysite.com or mysite.com/ should change to mysite.com/#/ as it does for deeper links.

@ghost ghost assigned IgorMinar Jan 7, 2014
@IgorMinar
Copy link
Contributor

we should set the path to / in this case, but not update the actual window.location.hash

the reason why we don't want to update window.location.hash is not to make address bar changes when user enters a site. it's ugly and intrusive.

caitp added a commit to caitp/angular.js that referenced this issue Jan 9, 2014
Before this change, on the root of the application, $location.path() would return
the empty string. Following this change, it will always return a root of '/'.

Closes angular#5650
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
Before this change, on the root of the application, $location.path() would return
the empty string. Following this change, it will always return a root of '/'.

Closes angular#5650
Closes angular#5712
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
Before this change, on the root of the application, $location.path() would return
the empty string. Following this change, it will always return a root of '/'.

Closes angular#5650
Closes angular#5712
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants