owner.component.html 1013 Bytes
Newer Older
1 2 3 4 5 6 7 8
<div *ngIf="error" class="alert alert-danger alert-dismissible fade show" role="alert">
  <strong>Error! </strong> {{ errorMessage }}
  <button type="button" (click)="vanishError()" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

<div class="container mt-3" *ngIf="owner">
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
  <h1>Owner Info for {{ owner.name }}</h1>
  <hr>
  <h4>Horses:</h4>
  <table class="table" *ngIf="horses; else noHorses">
    <thead>
      <tr>
        <th scope="col">#</th>
        <th scope="col">Name</th>
        <th scope="col">Actions</th>
      </tr>
    </thead>
    <tbody>
      <tr *ngFor="let horse of horses; let id = index">
        <td>{{ id + 1 }}</td>
        <td>{{ horse.name }}</td>
        <td>
          <a class="btn btn-primary" href="horse/{{ horse.id }}"><i class="fas fa-external-link-alt"></i></a>
        </td>
      </tr>
    </tbody>
  </table>
  <ng-template #noHorses>
    <p>Owner has no horses assigned.</p>
  </ng-template>
33
</div>