ngx-google-places-autocomplete icon indicating copy to clipboard operation
ngx-google-places-autocomplete copied to clipboard

Angular Universal: google is not defined

Open helgetan opened this issue 6 years ago • 3 comments

When running in Universal Mode, google is not defined there should be a wrapper around the google lib access to check for platformIsBrowser.

 ERROR ReferenceError: google is not defined
    at GooglePlaceDirective../node_modules/ngx-google-places-autocomplete/ngx-google-places-autocomplete.directive.js.GooglePlaceDirective.isGoogleLibExists (....)

helgetan avatar Jun 18 '19 13:06 helgetan

Hi Andreas,

I am having the same issue. You mentioned that there should be a wrapper around the google lib access to check for platformIsBrowser. Is this the fix?

Kind regards, Andrei

avidaicu avatar Dec 03 '19 23:12 avidaicu

@helgetan @avidaicu Have you guys managed to overcome this issue in any way?

nicolae-olariu avatar Oct 07 '20 09:10 nicolae-olariu

hi @helgetan , Basically, i can add a check for platformIsBrowser, but i am not sure that google autocomplete will work in that case as expected. Can you please share any example of the project with Angular Universal and that library?

skynet2 avatar Nov 03 '20 14:11 skynet2