angularjsphpstormwebstormphpstorm-2017.1

Autocomplete for AngularJS not working in PhpStorm / WebStorm


I'm trying to solve the following problem in my PhpStorm 2017.1:

In templates autocompletion for ng-* is not working and the IDE is highlighting ng-Attributes as not allowed:

Attribute ng-if is not allowed here

In directives and services it does not recognize angular.module():

Unresolved function or method module()

(it seems to know "factory" though)

I already installed the AngularJS and Angular Templates plugin...

enter image description here

... as well as downloaded the angular library:

enter image description here

What else could I try to solve this?

Edit: To follow up on lena's answer: I included AngularJS via bower. But the bower settings show no bower dependencies, although there are many in the bower.json:

enter image description here

Also when clicking on the plus button to install new packages I get this error:

enter image description here

So maybe that's the root of the problem? In the command line bower is working fine.


Solution

  • From screenshots it seems that AngularJS support is not enabled - built-in directives not recognized, all methods shown as plain text. Do you have angular.js file (debug version, not minified/scrambled) in your project (either in your project directory or configured as JavaScript library)? Normally it's enough to get Angular directives/methods recognized. Note that Typescript stubs ('definitely typed') won't work here, it should be a js library. See http://blog.jetbrains.com/webstorm/2014/03/angularjs-workflow-in-webstorm/, 'Include angular.js in Your Project' section.