0

I have an AngularJS 1.0.7 web application.

I´m trying to use $locationProvider in my app.js (in order to run htm5Mode), but when I run it, I get $locationProvider is undefined.

Do I need to load any extra js library? I don´t find any docs.

angular.module('myApp', [])
  .config(['$routeProvider', '$httpProvider', '$locationProvider',function($routeProvider, $httpProvider, $routeParams, $locationProvider) {

    // use the HTML5 History API
    $locationProvider.html5Mode(true); 

1 Answer 1

1

You miss $routeParams in your dependency injection

['$routeProvider', '$httpProvider', '$routeParams', '$locationProvider',
function($routeProvider, $httpProvider, $routeParams, $locationProvider)
1
  • I´m not using it and I forgot it :).
    – Rober
    Feb 18, 2015 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.