AngularJS: Remove # from URL

AngularJS builds URL with hashtag by default. To remove hashtag (#) from URL, there are 2 steps.

1) Set base for links

In your main HTML file, add the <base> tag in <head> section. This tag is required to make html5Mode working. See following example,

2) Set html5Mode to true

Use $locationProvider and set html5Mode to true. This will clean up the URLs by removing # tag. See following example,

You may also like...