0

am using angular in vscode but 'angular' is underline red saying that

angular is not defined: 'export namespace angular'

here is the code:

angular.module('kontrol', ['ngRoute'])config(['$locationProvider', '$routeProvider', '$provide', function ($locationProvider, $routeProvider) {
  $locationProvider.html5Mode(true)
  $locationProvider.hashPrefix('!')}
31piy
  • 23,323
  • 6
  • 47
  • 67
yaxx
  • 529
  • 1
  • 6
  • 22
  • 1
    Add `angular` to the list of globals in your `.eslintrc.js` file (or whatever the appropriate linter configuration file is) – Phil Dec 28 '17 at 00:56
  • 2
    Possible duplicate of [Global variables in Javascript and ESLint](https://stackoverflow.com/questions/41552041/global-variables-in-javascript-and-eslint) – Phil Dec 28 '17 at 00:58

1 Answers1

1

You should define globals in .eslintrc

"globals": {
    "angular": true
}
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • where do i find the .eslintrc, i navigated into the eslint folder but i could see the .eslintrc file so i added the "globals": { "angular": true } – yaxx Dec 28 '17 at 02:04
  • @yaxx https://eslint.org/docs/user-guide/configuring#specifying-globals – Sajeetharan Dec 28 '17 at 02:05