【问题标题】:Issues woriking with angularjs in vscode editor在 vscode 编辑器中使用 angularjs 的问题
【发布时间】:2018-06-08 13:54:20
【问题描述】:

我在 vscode 中使用 angular,但 'angular' 用红色下划线表示

angular is not defined: 'export namespace angular'

代码如下:

angular.module('kontrol', ['ngRoute'])config(['$locationProvider', '$routeProvider', '$provide', function ($locationProvider, $routeProvider) {
  $locationProvider.html5Mode(true)
  $locationProvider.hashPrefix('!')}

【问题讨论】:

标签: angularjs visual-studio-code


【解决方案1】:

您应该在 .eslintrc 中定义全局变量

"globals": {
    "angular": true
}

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2014-10-09
  • 1970-01-01
  • 2018-01-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-18
  • 1970-01-01
相关资源
最近更新 更多