The url I enter is http://localhost:8080/app/#/intro but it turns into http://localhost:8080/app/#!/intro#%2Fintro
Asked
Active
Viewed 797 times
0
-
can you show your code? – coderdark Dec 08 '16 at 18:47
-
1Looks like a router thing (without seeing any other code). – Tim Consolazio Dec 08 '16 at 18:50
-
1do you have htm5mode enabled? – coderdark Dec 08 '16 at 18:57
-
I don't have html5mode enabled. – timmcliu Dec 09 '16 at 20:44
-
1answered here http://stackoverflow.com/a/41121698/704133 – Mikhail Jan 28 '17 at 20:51
2 Answers
0
Turns out it has to do with angular updating to 1.6.0 where they changed the hash # to a hashbang #! syntax by default. If the app is loaded with a hash only url it adds that weirdness. The issue is gone if I just visit the #! version of the url directly.

timmcliu
- 1,769
- 1
- 13
- 12
0
Try use the Html5Mode,
Route Configuration:
$routeProvider
.when('/path', {
templateUrl: 'path.html',
});
$locationProvider
.html5Mode(true);
In your HTML set the base
<head>
<base href="/"/>
</head>
In this mode you can use links without the # in HTML files
<a href="/path">link</a>
Original post here $location / switching between html5 and hashbang mode / link rewriting

Community
- 1
- 1