How to dynamically add properties to TypeScript objects

preview_player
Показать описание
[key: string]: any; in your class/interface definition will do the trick.
Рекомендации по теме
Комментарии
Автор

It's callend an "Index Signature" and it's in the TypeScript Handbook under the section "Object Types"

Typhoon
Автор

why not putting any before the whole object then xD

tonyjaradev