【发布时间】:2016-08-26 11:37:41
【问题描述】:
我想在我的类型脚本(.ts)文件中使用 Jquery 库,并且我使用 原子编辑器。
为了实现这一点,我遵循了以下步骤
由于我使用 atom 编辑器,所以安装了 apm install atom-typescript
由于 Jquery 是外部 JS 库,我已经下载了类型化定义 来自here 并将文件放在我的应用程序文件夹中
3 在我的 test.ts 文件中添加了对 jquery.d.ts 的引用
下面是test.ts代码
/// <reference path="./node_modules/jquery/dist/jquery.d.ts" />
export class test {
$("#testID").val("test"); // editor shows ERROR in this line , "parameter declaration expected"
}
请让我知道我错过了什么。
【问题讨论】: