0

The url I enter is http://localhost:8080/app/#/intro but it turns into http://localhost:8080/app/#!/intro#%2Fintro

timmcliu
  • 1,769
  • 1
  • 13
  • 12

2 Answers2

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