Работает нормально

у использовать API Карт Google в своем проекте Angular, поэтому я использовал эти две команды для установки пакетов npm:

npm install @agm/core --save-dev
npm install @types/googlemaps --save-dev

Я добавил эту строку в свой компонент:

import {} from "@types/googlemaps";

Но я вижу эти 2 ошибки в VS Code:

[ts] File 'h:/Angular Projects/Breakfast/client/breakfast/node_modules/@types/googlemaps/index.d.ts' is not a module.
[ts] Cannot import type declaration files. Consider importing 'googlemaps' instead of '@types/googlemaps'.

Я добавил эти строки

"types": ["googlemaps"]
"moduleResolution": "node"

к tsconfig.json и tsconfig.spec.json, но все равно не повезло. В Chrome Dev Tools я вижу следующую ошибку:

Error: Uncaught (in promise): TypeError: Cannot read property 'Autocomplete' of undefined
TypeError: Cannot read property 'Autocomplete' of undefined

Угловая версия 6 Typescript Версия 2.9.2

Я пробовал с Angular 5 тоже.

Ответы на вопрос(6)

Ваш ответ на вопрос