i used @agm/core module from npm install @agm/core
this is my code
<agm-map [latitude]="lat" [longitude]="lng" >
<agm-marker *ngFor="let data of rooms"[latitude]="data.lat_long[0].lat" [longitude]="data.lat_long[0].long"></agm-marker>
</agm-map>
and this component.ts
export class ResultComponent implements OnInit {
lat: number ;
lng: number ;
rooms = ROOMS;
constructor() { }
ngOnInit() {
this.rooms = ROOMS;
this.lat = -6.914744;
this.lng = 107.609810;
}
}
but that's only showing one markers how to add multiple markers using *ngFor ??