I'm trying to implement the autocomplete using Angular 8 following the tutorial listed below. I have implemented this geolocator autocomplete several times in different versions of Angular, but today on Angular 8 I get the error:
Can't resolve parameters when using MapsAPILoader
Tutorial
https://brianflove.com/2016/10/18/angular-2-google-maps-places-autocomplete/
My Code:
import { ElementRef, NgZone, OnInit, ViewChild } from '@angular/core';
import { FormControl } from '@angular/forms';
import { } from 'googlemaps';
import { MapsAPILoader } from '@agm/core';
export class App implements OnInit {
...
constructor(
private mapsAPILoader: MapsAPILoader,
private ngZone: NgZone
) {}
ngOnInit() {}
If I remove this line:
private mapsAPILoader: MapsAPILoader
error goes away
Just took a look at the tutorial. If you just copied the code from App class then it won't work. You need to add the component decorator: