[英]Element implicitly has an 'any' type because expression of type '"name"' can't be used to index type 'Object'
Element implicitly has an 'any' type because expression of type '"name"' can't be used to index type 'Object'.元素隐式具有“任何”类型,因为“名称”类型的表达式不能用于索引类型“对象”。
this.resto.getCurrentResto(this.router.snapshot.params['id']).subscribe((result)=> { this.editResto.controls['name'].setValue(result['name']); this.editResto.controls['location'].setValue(result['location']); })
Keyword is implicitly .关键字是隐含的。 Typescript wants you to be explicit about using
any
. Typescript 希望您明确使用
any
.
this.resto.getCurrentResto(this.router.snapshot.params['id']).subscribe((result: any)=> { ... }
You will have to do the same for this.editResto.controls
if you have not defined a type for it.如果您没有为
this.editResto.controls
定义类型,则必须对其执行相同的操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.