Skip to content

Instantly share code, notes, and snippets.

@zukasmichael
zukasmichael / background-image.ts
Created January 29, 2018 02:22 — forked from fer-ri/background-image.ts
Background Image Style Directive for Angular 2 and Ionic 2
import {Directive, ElementRef, Input} from '@angular/core';
@Directive({
selector: '[background-image]'
})
export class BackgroundImage {
private el: HTMLElement;
constructor(el: ElementRef) {
this.el = el.nativeElement;
/**
* Threw together by Richard Willis - badsyntax.co
*/
var service = new google.maps.places.AutocompleteService();
var geocoder = new google.maps.Geocoder();
$(field).typeahead({
source: function(query, process) {
service.getPlacePredictions({ input: query }, function(predictions, status) {