Skip to content

Instantly share code, notes, and snippets.

@alxhub
Last active March 14, 2016 19:17
Show Gist options
  • Save alxhub/3b68552181f95b8f4675 to your computer and use it in GitHub Desktop.
Save alxhub/3b68552181f95b8f4675 to your computer and use it in GitHub Desktop.
import {Component, AfterViewInit, ElementRef, ViewChild} from 'angular2/core';
@Component ({
selector: 'my-google-place-search',
template: `<input #pacinput id= "pac-input" class="controls" type="text" placeholder="Address">`
})
export class GooglePlaceSearchComponent implements AfterViewInit {
@ViewChild('pacinput') ref: ElementRef;
ngAfterViewInit() {
var autocomplete = new google.maps.places.Autocomplete(this.ref.nativeElement, options)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment