-1

I was using the PUSH state in my site for SEO,

When i use PUSH state, It shows these Error which i have displayed below.

Uncaught Error: [$injector:modulerr] Failed to instantiate module projectApp due to:

Here is my AngularJS Code

<script>
var countryApp = angular.module('projectApp', ['ngSanitize']);
countryApp.config(['$location',function ($location) {
$location.html5Mode(true);
}]);
</script>
r.vengadesh
  • 1,721
  • 3
  • 20
  • 36
KesaVan
  • 1,031
  • 16
  • 32

1 Answers1

1

You are trying to inject a service into a config function. And it it not possible. Only constant and providers can be injected. Instead, inject $locationProvider.

countryApp.config(['$locationProvider',function ($locationProvider) {
   $locationProvider.html5Mode = true;
}]);
benek
  • 2,088
  • 2
  • 26
  • 38