角度误差TS7008:会员’摘要’隐含地具有’任何’类型
发布时间:2020-12-17 07:39:46 所属栏目:安全 来源:网络整理
导读:更新到角度2 RC后,我得到以下错误: error TS7008: Member 'summary' implicitly has an 'any' type. 在这行: @Input() summary; 怎么了? 编辑:好的,好像我在任何一个我的公共变量上都收到这个错误. 也许您更改了TypeScript编译器配置中noImplicitAny属性
更新到角度2 RC后,我得到以下错误:
error TS7008: Member 'summary' implicitly has an 'any' type. 在这行: @Input() summary; 怎么了? 编辑:好的,好像我在任何一个我的公共变量上都收到这个错误.
也许您更改了TypeScript编译器配置中noImplicitAny属性的值…请参阅tsconfig.json文件:
{ "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" ] } 您可以尝试在属性上添加一个类型.就像是: @Input() summary:string; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |