【问题标题】:Typescript Error with intellj EditorIntellij 编辑器的打字稿错误
【发布时间】:2017-06-28 16:43:58
【问题描述】:

我正在与Angular 1.6Typescript 合作项目。事实上,我没有任何编译错误。但现在我遇到了奇怪的错误。我没有更改代码,甚至应用程序运行正常。但是编辑器将这些说明标记为不正确。

import {auto} from 'angular';
method().then((data) => {})

【问题讨论】:

  • angularjs替换angular标签
  • 你有 Angular 的类型定义吗?
  • 当我打开打字目录时,内存错误的问题消失了

标签: javascript node.js angular typescript


【解决方案1】:

我认为您的 IDE 找不到 TypeScript 定义。

要告诉IDE关于Angular等包的Typescript对应结构,你需要安装某种TypeScript Definitions。

有不同的来源提供 TypeScript 定义:

https://github.com/jedmao/dt-angular

https://github.com/typings/typings

https://www.npmjs.com/package/@types/angular

https://github.com/borisyankov/DefinitelyTyped

【讨论】:

  • 问题是所有代码都编译得很好我没有这些错误。我不知道 intellj 发生了什么!该应用运行良好。
猜你喜欢
  • 2015-07-12
  • 1970-01-01
  • 1970-01-01
  • 2017-06-26
  • 1970-01-01
  • 1970-01-01
  • 2016-04-06
  • 2015-05-10
  • 2013-02-21
相关资源
最近更新 更多