简体   繁体   English

找不到命名空间的角度

[英]Cannot find namespace angular

I'm developing a Application using Angular and Typescript . 我正在使用AngularTypescript开发一个应用程序。 That time i'm facing this error. 那个时候我正面临着这个错误。

Error   21  Cannot find namespace 'angular'.

How to solve this?? 怎么解决这个?

Maybe you should add angular types to tsconfig.json as following: 也许您应该将角度类型添加到tsconfig.json,如下所示:

  {
...
"compilerOptions":
    ...
    "types": [
        "angular"
    ],
  }

If that won't work, since typings are deprecated, I suggest you to install @types/angular with npm: 如果这不起作用,因为不推荐使用打字,我建议你用npm安装@ types / angular:

npm install --save-dev @types/angular

and include it as above. 并包括如上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM