JSHint(r10):未定义“角度" [英] JSHint (r10): 'angular' is not defined

查看:141
本文介绍了JSHint(r10):未定义“角度"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下内容:

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

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

JSHint (r10): 'angular' is not defined. 

有人可以告诉我如何避免出现此消息吗?

解决方案

解决此问题的一种方法是修改您的.jshintrc并将angular设置为预定义变量之一,如Jayantha所说.

.jshintrc看起来像这样:

{
  "predef": ["angular"]
}

I have the following:

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

When I build this in VS2014 it gives me an error message saying:

JSHint (r10): 'angular' is not defined. 

Can someone tell me how I can avoid this message coming up?

解决方案

One way to tackle this is to modify your .jshintrc and set angular as one of the predefined variables, as Jayantha said.

.jshintrc would look like this:

{
  "predef": ["angular"]
}

这篇关于JSHint(r10):未定义“角度"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆