title: Cannot read property 'Autocomplete' of undefined while using google-places api
body: <p>I want to get LatLng of entered address in textbox. I am using google map api for it. By writing only <strong>new google.maps.places.Autocomplete({})</strong> I am getting <strong>Cannot read property 'places' of undefined</strong> this error.</p>
  
  <p>Below is my code:</p>
  
  <pre><code>@ViewChild('addressText') addressText: any;
  
  ngAfterViewInit() {
     this.getPlaceAutocomplete();
  }
  
  getPlaceAutocomplete() {
      const autoComplete = new google.maps.places.Autocomplete(this.addressText.nativeElement, {
        types: this.addressText.nativeElement.value
      })
      // google.maps.event.addListener(autoComplete, 'place_changed', () =&gt; {
      //   const place = autoComplete.getPlace();
  
      //   console.log('places... ', place);
      // })
    }
  </code></pre>
  
  <p><strong>html file:</strong></p>
  
  <pre><code>&lt;input matInput placeholder="Locations" class="input" formControlName="text" #addressText&gt;
  </code></pre>
  
  <p>Please help me out.</p>