0

Trying to get html5mode enabled, but I'm getting the 'you did something wrong' squiggles under $locationProvider.html5mode(true) in my IDE (WebStorm 8) with the following message in the title. Not sure what I'm doing wrong, so I figured another set of eyes would see what I'm missing.

(function () {
var app = angular.module("app", ['ngRoute']);
    app.config(function ($routeProvider, $locationProvider){
        $routeProvider
            //.when code

        $locationProvider.html5Mode(true);
    });
    //app.controller...
}());
TheSharpieOne
  • 25,646
  • 9
  • 66
  • 78
Rex_C
  • 2,436
  • 7
  • 32
  • 54
  • I don't see anything wrong with your code. When you say "squiggles", do you mean in your editor or IDE? The error text you included has the 'M' as lowercase and it should be uppercase (your shown code is correct). Just pointing that out in case you wrote it here manually and inadvertently corrected the problem. – Terry Oct 03 '14 at 19:20
  • Sorry, yes in my IDE. I'm using WebStorm 8. – Rex_C Oct 03 '14 at 19:31
  • Then it's just an intellisense problem, I wouldn't worry about it unless it breaks your app at runtime. If it bothers you (it would bother me) then you may want to see if there is an update for the Angular intellisense/autocomplete. – Terry Oct 03 '14 at 22:43
  • It does make my views not render when I add html5mode(true). Not sure if its because of the above issue or something else. – Rex_C Oct 03 '14 at 22:56
  • please see http://stackoverflow.com/questions/13832529/how-to-config-routeprovider-and-locationprovider-in-angularjs - may be the issue – lena Oct 07 '14 at 15:13
  • 1
    as for the initial issue, html5Mode() is correctly resolved for me in webStorm 8.0.4. do you have angular.js file (debug version, uncompressed) in your project folder? – lena Oct 07 '14 at 15:16

1 Answers1

1

I resolved my issue the following way:

I randomly came across the following question: How do I enable Webstorm intellisense for AngularJS when writing CoffeeScript

What I think part of the problem was that Angular wasn't installed in WebStorm, so my intellisense wasn't picking up the syntax. After downloading and enabling Angular into my IDE, the IDE picked up the

$locationProvider.html5mode(true);

snippet of code and was able to get rid of the hash in my urls.

Community
  • 1
  • 1
Rex_C
  • 2,436
  • 7
  • 32
  • 54