Answers for "error TS4111: Property 'name' comes from an index signature, so it must be accessed with ['name']."

1

error TS4111: Property 'name' comes from an index signature, so it must be accessed with ['name'].

error : {{ cardForm.controls.name.errors | json}} // this is error for formControlName name

fix : {{ cardForm.controls['name'].errors | json}} // formControlName inside ['']

or

fix : {{ cardForm.get('name')?.errors | json}}
Posted by: Guest on March-11-2022

Code answers related to "error TS4111: Property 'name' comes from an index signature, so it must be accessed with ['name']."

Code answers related to "TypeScript"

Browse Popular Code Answers by Language