Guest User

Untitled

a guest
Jul 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import { Directive, ElementRef, OnInit } from '@angular/core';
  2.  
  3. declare var google:any;
  4.  
  5. @Directive({
  6. selector: '[google-place]'
  7. })
  8. export class GooglePlacesDirective implements OnInit {
  9. private element: HTMLInputElement;
  10.  
  11. constructor(private elRef: ElementRef) {
  12. this.element = elRef.nativeElement;
  13. }
  14.  
  15. ngOnInit() {
  16. const autocomplete = new google.maps.places.Autocomplete(this.element);
  17. }
  18.  
  19. }
Add Comment
Please, Sign In to add comment