wwjdm
wwjdm

Reputation: 2596

Angular: Reference object in template

I have:

<ng-container *ngIf="vortexFeed">
  <agm-marker
      *ngFor="let m of mVortex; let i = index"
      (markerClick)="clickedMarker(m.label, i)"
      [latitude]="m.lat"
      [longitude]="m.lng"
      [label]="m.label"
      [markerDraggable]="m.draggable"
      (dragEnd)="markerDragEnd(m, $event)">

    <agm-info-window>
      <strong>Alert</strong>
    </agm-info-window>

  </agm-marker>
</ng-container>

Instead of "Alert" I want m.class. How can I reference the "m" object?

Upvotes: 0

Views: 74

Answers (2)

radtelbi
radtelbi

Reputation: 635

if you want to output the m.class property you can use

 <agm-info-window>
  <strong>{{m.class}}</strong>
</agm-info-window>

more infos on string interpolation in the Angular docs

Upvotes: 2

Alexandr2134
Alexandr2134

Reputation: 272

replace Alert with {{m.class}}

Upvotes: 1

Related Questions