fork of hey-api/openapi-ts because I need some additional things
1@let pet = petState.data();
2<div class="pet-store-header">
3 <button mat-raised-button color="primary" (click)="getRandomPet()">
4 Get Random Pet
5 </button>
6
7 <mat-card class="pet-card mat-elevation-z8">
8 @if (petState.isLoading()) {
9 <mat-spinner />
10 }
11
12 @if (pet) {
13 <mat-card-header>
14 <mat-card-title class="pet-card-title">{{ pet.name }}</mat-card-title>
15 <mat-card-subtitle class="pet-card-subtitle">{{
16 pet.category?.name
17 }}</mat-card-subtitle>
18 </mat-card-header>
19 <!-- <img mat-card-image [src]="pet.photoUrls.at(0)" alt="{{ pet.name }}" class="pet-card-image" /> -->
20 <mat-card-content>
21 <p class="pet-status">
22 Status: <b>{{ pet.status }}</b>
23 </p>
24 </mat-card-content>
25 }
26 </mat-card>
27</div>
28
29@if (addPet.data()) {
30 <pre>
31 <code>{{addPet.data()|json}}</code>
32 </pre>
33}
34
35@if (updatePet.data()) {
36 <pre>
37 <code>{{updatePet.data()|json}}</code>
38 </pre>
39}
40
41<form #petForm="ngForm" (submit)="onSubmit(petForm)">
42 <mat-card class="pet-form-card mat-elevation-z4">
43 <mat-card-header>
44 <mat-card-title
45 ><span class="pet-form-title">Pet Form</span></mat-card-title
46 >
47 </mat-card-header>
48 <mat-card-content class="pet-form-content">
49 <mat-form-field appearance="fill">
50 <mat-label>Name</mat-label>
51 <input matInput name="name" [(ngModel)]="nextPetState.name" required />
52 </mat-form-field>
53 </mat-card-content>
54 <mat-card-footer>
55 <mat-card-actions class="actions">
56 <button mat-raised-button color="primary" type="submit">Add Pet</button>
57 <button
58 mat-stroked-button
59 color="accent"
60 (click)="handleUpdatePet($event)"
61 >
62 Update Pet
63 </button>
64 </mat-card-actions>
65 </mat-card-footer>
66 </mat-card>
67</form>