Is there a way for WebStorm to "see" the methods in my HTML and link them with their respective component class?
Details
I usually write my component controller in one file and the component template (html) in another file.
When I do this, methods that are only used in the template are marked as "unused" by WebStorm, and they throw a warning.
For example, in the component ctrl I have a handleViewChange()
method.
In the template file I have vm.handleViewChange()
;
WebStorm warns me that handleViewChange
is an unused method even though I have used it in the template.
Please note: I am aware that I can suppress the warn for this particular statement. I would rather WebStorm recognized the method is actually used.
Particularly relevant with refactor-happy colleagues (or refactor-happy future me).
Edit #1
I have already enabled the AngularJS library in Webstorm settings, but it does not fix this particular issues.
ng-app
,ng-controller
, etc) recognized? Can you jump to method definitions from your template files? If Angular support is off - see my answer for instructions on enabling it. If it's on, and methods are still marked unused, etc, please provide code snippets that show methods definition and usages – lena