How to install Typescript typings for google maps

前端 未结 12 1087
春和景丽
春和景丽 2020-11-28 04:07

How can it be done - I\'ve tried combinations of

typings install [googlemaps | google.maps] [--ambient] --save

and end up with variations o

12条回答
  •  -上瘾入骨i
    2020-11-28 04:15

    Stephen Paul clearly explains everything, but there is something important to mention. tsconfigs can extend each other. And extended one can overwrite the parent one. In my case I had another tsconfig.app.json under app directory which has

    types: []
    

    arrays. As Stephen already explained this empty array overrides typeRoots. So just remove all types arrays in ALL related tsconfig files and ensure that

    "typeRoots": ["node_modules/@types"]
    

    is present. Needless to say that @types@googlemaps must be installed

提交回复
热议问题