I am working on an Angular5 app and have a component.html file with a function called markerClick that opens a modal. However, I am facing challenges in displaying the item.lat parameter in the modal and would appreciate your assistance.
Below is the code for component.ts followed by the code for component.html.
open(content, latTmp) {
this.modalService.open(content, latTmp).result.then((result) => {
this.closeResult = `Closed with: ${result}`;
}, (reason) => {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
});
console.log(latTmp);
}
<div style="text-align:center">
<h1>
Welcome to {{ title }}!
</h1>
<agm-map [latitude]=57.107118 [longitude]=12.2520907 [zoom]="4">
<ng-container *ngFor="let item of station">
<agm-marker [latitude]="item.Lat" [longitude]="item.Lng" (markerClick)="open(content, item.Lat)">
</agm-marker>
</ng-container>
</agm-map>
</div>
<ng-template #content let-c="close" let-d="dismiss">
<div class="modal-header">
<h4 class="modal-title">Station Info</h4>
<button type="button" class="close" aria-label="Close" (click)="d('Cross click')">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>Test Hardware 1, sätt behörighet…</p>
<p>Test Hardware 2…</p>
**HERE I WANT TO DISPLAY ITEM.LAT PARAMETER SENT FROM THE MARKERCLICK FUNCTION!!!!!**
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-dark" (click)="c('Close click')">Close</button>
</div>
</ng-template>