I've been attempting to remove the hash tag from my URL in AngularJS. After some research, I discovered that I need to use $locationProvider
, but I'm unsure which dependency is required to make this work.
This is my Angular code:
angular.module('airlineApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute'
]).config(function($routeProvider, $locationProvider) {
$routeProvider
.when('/testing', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.otherwise({
redirectTo: '/'
});
$locationProvider.html5Mode(true);
});
However, it seems that this solution isn't working, and I suspect it's because I am missing the locationProvider
.
To try and resolve this issue, I used bower to install dependencies. For locationProvider
, I tried:
bower install --save locationProvider
Unfortunately, this package doesn't seem to exist. I also searched through Bower Packages with no success.
As someone new to Angular, I may be overlooking something obvious. Can you help me figure out what's wrong?
Thank you!