Angular ng- syntax not recognized..

Hey folks, I've been a user for over a year now, using the latest version of Webstorm (145.844.3 currently) and I've never been able to get AngularJS syntax to be recognized properly.

For example, if I create simple <div ng-if="test"> statement, it shows that as invalid:

I've gone through all of the documentation and community support, and I've verified the AngularJS plugin is installed properly, I have Angular setup through Bower and included in my app fine, and also have the external library references in Settings > Javascript > LIbraries:

I'm not sure what I'm missing.. would be nice to use this since 95% of my work is in Angular.

Any help is appreciated!

Comment actions Permalink

Hi there,

I'm not AngularJS user by any means ... but I have seen similar kind of threads in the past (at least for v1.x) .. and typical issue was that the actual non-minified alngularjs library was not part of the project (yeah, you have to place such file anywhere in the project).

For Angular 2 you may want to check this one:

Comment actions Permalink

Thanks! It looks like that may have done it!

Update: Spoke too soon, even with angular.js (rather than .min.js) included in my bower scripts, still no go.

I appreciate the suggestion, though.

Comment actions Permalink

As it turns out, I had excluded my /bower_components from being indexed. Once I included it, it worked!

However, I don't like including /bower_components because it adds tons of things I don't want into my search result, so instead I just copied the angular.js file from /bower_components/angular to a separate folder (I used the folder above my project folder) then went to File > Settings > Languages > Javascript > Libraries and added it there.

Another approach would be to exclude everything in /bower_components except for the /bower_components/angular folder.


Please sign in to leave a comment.