PhpStorm中的未定义指令

时间:2015-01-26 16:46:18

标签: angularjs phpstorm webstorm

我在Angular中使用PhpStorm。 如果我这样声明指令:

angular.module('myDir', [])
    .directive('myDir', [function () {
        return {
            restrict: 'E',
            link: function (scope, elm, attrs, controller) {

            }
        }
    }]);

PhpStorm对HTML标签进行了重新规范并且运行良好(例如ctrl + lmb =转到声明)。

但是,当我切换到该代码(https://github.com/johnpapa/angularjs-styleguide首选)时,PhpStorm会向我提供未知的HTML标记消息。

angular.module('myDir', [])
    .directive('myDir', myDir);

function myDir() {
    return {
        restrict: 'E',
        link: function (scope, elm, attrs, controller) {

        }
    }
}

有没有办法解决它?

1 个答案:

答案 0 :(得分:1)

https://youtrack.jetbrains.com/issue/WEB-14092 - 相应地说明此问题已得到解决。

修复将在下一个PhpStorm版本中提供 - 必须是#140.1763或更新版本(很可能是PhpStorm v9)。