javascript - angular2运行报错: error TS2304: Cannot find name '$'.
本文介绍了javascript - angular2运行报错: error TS2304: Cannot find name '$'.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
如题,我要该怎么改文件,在哪改?
这是报错:
这里是tsconfig文件:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}
主要原因就是我在这两个文件用了bootstrap的模态框,用了$().modal('hide');
然后模态框是可以用的,但是报错的意思好像是找不到$
符号??
解决方案
已解决:在browser.d.t文件中写入declare var $:any;
这篇关于javascript - angular2运行报错: error TS2304: Cannot find name '$'.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文