Hey there! I've incorporated the ng4-autocomplete component into my custom component and now I'm trying to figure out how to detect when the autocomplete dropdown closes. Can you help me out with implementing the "closeAutocomplete" method?
Let's take a look at my location.component.html file:
<ng4geo-autocomplete (click)="showAutocomplete()"
[userSettings]="location"
(componentCallback)="componentCallback123($event)" placeholder=""
(closeAutocomplete)="closeAutocomplete($event)"
>
</ng4geo-autocomplete>
And here is what I have in my location.component.ts file:
import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';
@Component({
selector: 'mitra-location',
templateUrl: './location.component.html',
styleUrls: ['./location.component.scss']
})
export class LocationComponent implements OnInit {
@Input('location') location = '';
@Output('callback') callback = new EventEmitter<any>();
locationElem;
ngOnInit() {
this.locationElem = document.getElementById('geo-location');
}
closeAutocomplete(event) {
// Need to handle this event
}
}
If you need more information about this component, check out the documentation here.
Thanks a bunch!