<svg id="svg"
     version="1.1"
     xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     (mousedown)="this.onMousedown($event)"
     (mousewheel)="this.onMousewheel($event)">
  <g uxg-arrow
     *ngFor="let arrow of (this.canvasService.arrows | toIterable)"
     [arrow]="arrow"></g>
  <g uxg-card
     *ngFor="let card of (this.canvasService.cards | toIterable)"
     [card]="card"
     [canvasBoundsGetter]="getBounds"></g>
</svg>

<svg id="svg"
     version="1.1"
     xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     (mousedown)="this.onMousedown($event)"
     (mousewheel)="this.onMousewheel($event)">
  <g uxg-arrow
     *ngFor="let arrow of (this.canvasService.arrows | toIterable)"
     [arrow]="arrow"></g>
  <g uxg-card
     *ngFor="let card of (this.canvasService.cards | toIterable)"
     [card]="card"
     [attr.card-id]="card.id"
     [canvasBoundsGetter]="getBounds"></g>
</svg>

Add the card id as an attribute on the card's HTML element
Add the card id as an attribute on the card's HTML element
