Is it possible to remove the # symbol from angular.js URLs?
I still want to be able to use the browser\'s back button, etc, when I change the view and will update th
Start from index.html remove all #
from About Us
so it must look like About Us
.Now in head tag of index.html write
just after last meta tag.
Now in your routing js inject $locationProvider
and write $locatonProvider.html5Mode(true);
Something Like This:-
app.config(function ($routeProvider, $locationProvider) {
$routeProvider
.when("/home", {
templateUrl: "Templates/home.html",
controller: "homeController"
})
.when("/aboutus",{templateUrl:"Templates/aboutus.html"})
.when("/courses", {
templateUrl: "Templates/courses.html",
controller: "coursesController"
})
.when("/students", {
templateUrl: "Templates/students.html",
controller: "studentsController"
})
$locationProvider.html5Mode(true);
});
For more Details watch this video https://www.youtube.com/watch?v=XsRugDQaGOo