WebStorm - “angular” is not defined

后端 未结 5 2214
庸人自扰
庸人自扰 2021-02-05 07:10

NOTE: This is a WebStorm issue, not an angular.js issue.

Screencast of the problem: http://f.cl.ly/items/302s0d1k1i3i1B2p0W09/ws703-angular-not-defined.mp4

Descr

5条回答
  •  耶瑟儿~
    2021-02-05 07:46

    The very first example in the documentation page of JSHint is the following:

    Configuration file is a simple JSON file that specifies which JSHint options to turn on or off. For example, the following file will enable warnings about undefined and unused variables and tell JSHint about a global variable named MY_GLOBAL.

    {
      "undef": true,
      "unused": true,
      "globals": { "MY_GLOBAL": false }
    }
    

    Replace MY_GLOBAL with angular, and you won't have this JSHint warning anymore.

提交回复
热议问题