Visual Studio Code complains that it “Cannot find namespace” for types defined in *.d.ts files

前端 未结 4 1240
甜味超标
甜味超标 2021-01-19 10:06

I created a new project using the gulp-angular Yeoman generator with language set to TypeScript. Then ran the Gulp build process and also opened the page in a web browser, w

4条回答
  •  轮回少年
    2021-01-19 10:33

    I found the following in a discreet location in the code. Likely put there to avoid type errors. Seems like vscode encountered this and redefined the global 'angular' variable as type of 'any'.

    var angular = window['angular'];
    

提交回复
热议问题