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: http://prntscr.com/ardbww

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: http://prntscr.com/ardlcg

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!

0
3 comments

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).

http://blog.jetbrains.com/webstorm/2014/03/angularjs-workflow-in-webstorm/

For Angular 2 you may want to check this one: http://blog.jetbrains.com/webstorm/2016/04/angular-2-workflow-in-webstorm/

0
Avatar
Permanently deleted user

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.

0
Avatar
Permanently deleted user

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.

0

Please sign in to leave a comment.