Removing the fragment identifier ‘#’ from Angular JS url.

Angular JS routing without ‘#’ is possible as ‘#’ is not required in modern browsers, that support the Html5 API. First of all, you need to create a .htaccess file, then add it to the code below.
Two important things need to be done.

1. Configuration of $location provider.
2. Setting/Add base for relative links.

  • In Router section , add html5 Mode(true);
app.config(function($routeProvider,$locationProvider) { $routeProvider.when('/home', { templateUrl:'/html/home.html'}); $locationProvider.html5Mode(true); })
  • Add base tag in Html head.

Recent Blogs


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

To Know Us Better

Browse through our work.

Explore The Technology Used

Learn about the cutting-edge technology and techniques we use to create innovative software solutions.