Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Directive, ElementRef, OnInit } from '@angular/core';
- declare var google:any;
- @Directive({
- selector: '[google-place]'
- })
- export class GooglePlacesDirective implements OnInit {
- private element: HTMLInputElement;
- constructor(private elRef: ElementRef) {
- this.element = elRef.nativeElement;
- }
- ngOnInit() {
- const autocomplete = new google.maps.places.Autocomplete(this.element);
- }
- }
Add Comment
Please, Sign In to add comment