1

To navigate between the routes using the anchor tag if i specify the path as below it does not work-

<a href="#/link1">Go to link1</a>

Instead if i specify below path it works

<a href="#!/link1">Go to link1</a>

using AngularJS 1.6.1 version. Browser IE 11.0. Why this behavior? I have used previsouly AngularJS 1.2 -1.3 version, but did not get this issue before.

Bhalchandra K
  • 2,631
  • 3
  • 31
  • 43

1 Answers1

0

Make some transformation on url with $urlRouterProvider.rule in your config function like below:

$urlRouterProvider.rule(function ($injector, $location) {
    var path = $location.path(),
        normalized = path.replace('!/', '');
        if (path !== normalized) {
            return normalized;
        }
});

You could follow the following links,

Angular force an undesired exclamation mark in url

angular url is adding unwanted characters

Community
  • 1
  • 1
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396