How to remove the hash # from the angularjs ng-route

you can use the $locationProvider like this –

$locationProvider.html5Mode({
  enabled: true,
  requireBase: false
});

Alternatively, you can use the base tag in your index.html (I suppose this is your landing page)

<head>
  <base href="https://stackoverflow.com/">
</head>

Removing base tag may cause some side effects in old IE browser like IE9

Leave a Comment