相关疑难解决方法(0)

JSHint(r10):'angular'未定义

我有以下内容:

angular.module('test')
    .controller('TestMenuController',
    [
        '$http',
        '$scope',
        '$resource',
        '$state',
        'os',
        'us',
    function (
        $http,
        $scope,
        $resource,
        $state,
        os,
        us) {
Run Code Online (Sandbox Code Playgroud)

当我在VS2014中构建它时,它给出了一条错误消息:

JSHint (r10): 'angular' is not defined. 
Run Code Online (Sandbox Code Playgroud)

有人能告诉我如何避免这个消息出现吗?

visual-studio jshint angularjs

39
推荐指数
2
解决办法
2万
查看次数

JSHint在Webstorm和Grunt中表现不同

我使用角度生成器使用Grunt创建了一个新服务,然后使用WebStorm Ctrl+ ALT+L重新格式化代码,因为标签/空格似乎不同.

然后当使用Grunt和任务JShint抱怨我得到以下错误:

app/scripts/services/poteservice.js
  line 11  col 13  Expected '}' to have an indentation at 15 instead at 13.
  line 14  col 13  Expected '}' to have an indentation at 15 instead at 13.
Run Code Online (Sandbox Code Playgroud)

另一个奇怪的问题是我发现我可以在WebStorm中启用JSHint,但后来我遇到了类似的问题

 JSHINT: angular not defined

    and

 Use the function form of use strict
Run Code Online (Sandbox Code Playgroud)

任何人都知道如何让每个人都很好地一起玩,即WebStorm和Grunt等.

我确实安装了角度的WebStorm插件.

有人可以帮忙吗?

javascript webstorm jshint angularjs gruntjs

2
推荐指数
1
解决办法
1790
查看次数