Remove Hashtag From URL in AngularJS

Remove Hashtag From URL in AngularJS

Today, We want to share with you Remove Hashtag From URL in AngularJS.
In this post we will show you Pretty URLs in AngularJS: Removing the #, hear for Removing Hashbang from URL in AngularJs Route we will give you demo and example for implement.
In this post, we will learn about Removing “#” From URL in AngularJS with an example.

How to remove # from URL in AngularJS?

If you work on AngularJS any SPA’s or web application using angular multiple pages or route then you notice most useful one thing. If you check any link click on any hyper links it creates like as bellow simple generated URI:

Also Read This πŸ‘‰   Laravel 7 Create Seeder From Database Tutorial Example

We stands always put “#” symbols will be add there, So when we live this any application or web application then it should remove or delete “#” Special Symbols from Your Angular Routing URL, because it creates issue when we some share link on Social media facebook, Twitter, Linkdin or etc.

Enabling Base URL (Relative URLs)

If We are using Latest New version of an Angularjs, then We can simple directly write this Scripts to enable Your html5mode.


But You can delete or remove simple Way to easily using angular “$locationProvider.html5Mode(true);”. You can do it like as bellow simple example We did, So Create sure you have to simple first add HTML base tag on your HTML head tag sections like as bellow scripts:

Also Read This πŸ‘‰   MySQL sample database file extension and location

....//Some Title//External Links...//Devloped By :

Simple Angular JS Route

var liveapp = angular.module('live-App',['ngRoute']);
function($routeProvider, $locationProvider) {
when('/', {
templateUrl: 'templates/students.html',
controller: 'StudentCtrl'
when('/teachers', {
templateUrl: 'templates/teachers.html',
controller: 'TeacherCtrl'
redirectTo: '/'

//It's Most Imp.

Free Live Chat for Any Issue

Remove # from URL AngularJS : Conclusion

This is the Very Useful way to Delete or remove Hash From Application URL and get a SEO based pretty URL.

We hope you get an idea about Remove Hashtag From The Routing URL – $locationProvider
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like Face Book Page.

We hope This Post can help you…….Good Luck!.