Q: WebStorm doesn't recognize AngularJS 'vm' variable I am currently using the AngularJS plugin. It's really helpful.
The only downside is that it doesn't recognize the vm variable.
I use these settings in my directive to use the vm variable in my view:
controllerAs: 'vm',
bindToController: true

However, WebStorm doesn't recognize it and gives this error:


A: I have just tested with both WebStorm and IntelliJ with the AngularJS plugin and in both cases the templates that include the ng-controller directive in their root element recognize the variable in the template and those without it do not. I would suggest adding it to your template to solve the problem.
<div ng-controller="commitmentController as cc">
    <div class="margin-top-bottom">
        <a ui-sref="commitmentList" ng-click="cc.sessionManager.okToContinueWithUnsavedChanges()"
           role="button"><span class="glyphicon glyphicon-chevron-left">
           </span>Back to All Commitments
        </a>
    </div>
    <!-- Rest of template here -->
</div>


A: This is a bug in Webstorm. See @tokkov his answer for a possible workaround.
See the bug in the issue tracker here: https://youtrack.jetbrains.com/issue/WEB-20676
