我已尝试安装角度的打字,我不知道如何解决错误。任何建议或帮助都会很棒!
以下是错误消息:
C:\ Users \ test \ Desktop \ ProjectTemplate \ ProjectTemplate.Web \ Content \ node_modules \ @types \ angularjs \ index.d.ts中的错误 (1839,15):错误TS2430:接口'IAugmentedJQuery'错误地扩展了接口'JQuery'。 属性'find'的类型是不兼容的。 输入'{(selector:string):IAugmentedJQuery; (element:any):IAugmentedJQuery; (obj:JQuery):这个; (选择器:st ...'。 类型'IAugmentedJQuery'不能指定为'this'类型。
这是我的package.json:
{
"name": "projecttemplate",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack --config configs/webpack.config.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@types/angular": "^1.6.29",
"@types/angularjs": "^1.5.14-alpha",
"@types/jquery": "^3.2.11",
"css-loader": "^0.28.5",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
"node-sass": "^4.5.3",
"sass-loader": "^6.0.6",
"style-loader": "^0.18.2",
"ts-loader": "^2.3.3",
"typescript": "^2.4.2",
"typings": "^2.1.1",
"webpack": "^3.5.5"
},
"dependencies": {
"angular": "^1.6.6",
"angular-route": "^1.6.6",
"angular-ui-bootstrap": "^2.5.0",
"bootstrap": "^3.3.7",
"font-awesome": "^4.7.0",
"jquery": "^3.2.1"
}
}
答案 0 :(得分:2)
降级到jQuery类型v2是解决方案。增强jQuery的角度类型尚未更新。感谢您提供解决方案@AluanHaddad