我在角度5项目中添加了NGBootstrap.但过了一段时间它没有工作,我得到低于错误.试图通过升级CLI版本解决问题,但仍然没有解决问题.请检查package.json.
src/app/app.module.ts(5,27)中的错误:错误TS2307:找不到模块'@ ng-bootstrap/ng-bootstrap'.src/app/find-product/searchtabcontent/search-by-family/search-by-family.component.ts(2,48):error TS2307:找不到模块'@ ng-bootstrap/ng-bootstrap'
的package.json
{
"name": "ng5",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"build": "ng build --prod --base-href=/UI/pages/",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"@ng-bootstrap/ng-bootstrap": "^1.1.2",
"core-js": "^2.4.1",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
},
"devDependencies": {
"@angular/cli": "^6.0.1",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2", …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在对象中添加新属性,但打字稿给出错误。
错误 TS2339:类型“对象”上不存在属性“数量”。
product: Object = {qty: Number};
foo(){
this.product.qty = 1;
}
Run Code Online (Sandbox Code Playgroud) 这太疯狂了.我只是想为数组声明变量.一个简单的声明生成TS1005.我也升级了Typescript版本,但没有运气.
errorList = Array<{severity: string}>;
Run Code Online (Sandbox Code Playgroud)
当前版本的Typescript是2.8.3.