Issue description
Hi :)
Im using this library with google places api.
So I lazy load the js file:
this.places = new google.maps.places.Autocomplete(el.nativeElement.children[0], {
types: ['(cities)'],
componentRestrictions: { country: 'fr' }
});
The problem is that the typescript compiler is telling me Cannot find name 'google'
since it loads dynamically I guess i cannot use the /// <reference path="???" />
Any ideas?
After your imports or as a private class member define
declare var google: any;
@brian-singer Thanks! looking good :)
Not working for me, Any snippet would be grate?
A bit late to the party, but in case someone ends up on this page...
This worked for me:
npm install @types/googlemaps --save
Then in the component where I use the google name:
import { } from '@types/googlemaps';
I hope it helps.
Hello.
I've got next error message after added import { } from '@types/googlemaps': error TS6137: Cannot import type declaration files.
declare var google: any; not working for me.
In tsconfig after yarn add -D @types/googlemaps "types": ["googlemaps"] not working too.
Anybody know another hacks?
Most helpful comment
Not working for me, Any snippet would be grate?