Issue
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']); })
Solution
Keyword is implicitly. Typescript wants you to be explicit about using 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.
Answered By - Chris Hamilton
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.