【发布时间】:2015-11-18 10:16:17
【问题描述】:
我试过了
tsd install jquery --save
tsd install bootstrap --save
而 tsd.json 会是
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"jquery/jquery.d.ts": {
"commit": "c5a2f44bab06cf9f2bcc14530171daac1cebff6c"
},
"bootstrap/bootstrap.d.ts": {
"commit": "c5a2f44bab06cf9f2bcc14530171daac1cebff6c"
}
}
}
而 tsd.d.ts 是
/// <reference path="jquery/jquery.d.ts" />
/// <reference path="bootstrap/bootstrap.d.ts" />
所以,我认为我可以做到
/// <reference path="../../typings/tsd.d.ts" />
import $ = require('jquery');
$('#modal').modal();
但是我收到了这个警告。
Uncaught TypeError: t(...).modal is not a function
有什么想法吗?
【问题讨论】:
-
这应该像你写的那样工作,实际的错误是什么?你写的 t(...).modal 不是一个函数。但我没有看到 t(...)
-
编译后,浏览器控制台显示如下消息
Uncaught TypeError: t(...).modal is not a function。我想这意味着引导程序没有注入 jQuery :(
标签: twitter-bootstrap-3 typescript typescript1.5