Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeScript A computed property name in a type literal must directly refer to a built-in symbol

Tags:

typescript

ERROR in ...component.ts (..,..): A computed property name in a type literal must directly refer to a built- in symbol. ...: Cannot find name 'any'.

I'm looking forward an object which contains strings which have other string, i.e:

{ abc: 'xyz' } 

What I did:

foo: { [string]: string }; 
like image 574
zurfyx Avatar asked May 22 '17 10:05

zurfyx


1 Answers

An identifying name on the computed value is required:

foo: { [bar: string]: string }; 
like image 86
zurfyx Avatar answered Sep 22 '22 07:09

zurfyx