I have project angular-cli
~root~/src/typings.json
{
\"globalDevDependencies\": {
\"angular-protractor\": \"registry:dt/angula
In IONIC 4 I fixed it by installing @types/google-maps not @types/googlemaps
just run this
npm install @types/google-maps --save
and import google in your component using
import { google } from "google-maps";
Try to run the below command in a node prompt...
typings install dt~google.maps --global --save
I had the same problem with angular 7.
I did not need to import anything just run npm install @types/googlemaps
again and if there is any vulnerabilities, run npm audit fix
or npm audit fix --force
if needed.
After I did so, everything worked fine for me...
A bit of a late response but I had a similar issue using Angular CLI RC.0.
It turned out that I hadn't install and imported the typings, which can be done as follows:
npm install --save-dev @types/googlemaps
import {} from '@types/googlemaps';
For anyone in Vue js facing this issue, you can add the following line at the top of your script section. Make sure you have installed @types/googlemaps
.
/// <reference types="@types/googlemaps" />
For Angular 9.****
I tried installing @types/googlemaps, It did not work for me.
I downgrade it to "@types/googlemaps": "3.39.12" then worked perfectly fine.
this is my code
In tsconfig.app.json (add googlemaps to types array)
"types": [
"googlemaps"
]
In app module.ts
import { AgmCoreModule } from '@agm/core';
.
.
.
.
imports: [
BrowserModule,
AppRoutingModule,
AgmCoreModule.forRoot({
apiKey: '...KEY...',
libraries: ['places']
})
],
To downgrade @types/googlemaps, go to pakage.json file in the project root folder and change @types/googlemaps version to "3.39.12". it's better if you delete files form
node_module -> @types -> googlemaps
Then in the terminal enter
npm install