Skip to content

Commit bd30833

Browse files
committed
update angular
1 parent 448af39 commit bd30833

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

MyApp/_pages/releases/v8_07.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,30 @@ E.g. the `<form-loading>` component will display when API Requests are in-flight
668668
</app-page>
669669
```
670670

671+
### Create Booking
672+
673+
The [booking-create.component.ts](https://github.com/NetCoreTemplates/angular-spa/blob/main/MyApp.Client/src/app/bookings/booking-create.component.ts) shows the standard pattern of calling ServiceStack Typed APIs to
674+
save forms whilst saving any validation errors to the `ApiState` context:
675+
676+
```ts
677+
async save(): Promise<void> {
678+
this.api.begin();
679+
680+
const request = new CreateBooking(this.booking());
681+
const api = await this.client.api(request);
682+
if (api.succeeded) {
683+
// Navigate back to bookings list after successful save
684+
this.router.navigate(['/bookings']);
685+
}
686+
687+
this.api.complete(api.error);
688+
}
689+
```
690+
691+
Where any contextual validation will be displayed next to the input field:
692+
693+
[![](/img/pages/templates/angular-spa/angular-booking-create-validation.webp)](https://angular-spa.web-templates.io/bookings/create)
694+
671695
### Edit Booking
672696

673697
The [booking-edit.component.ts](https://github.com/NetCoreTemplates/angular-spa/blob/main/MyApp.Client/src/app/bookings/booking-edit.component.ts)

MyApp/_pages/templates/angular.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,30 @@ after receiving failed API Responses:
277277
</app-page>
278278
```
279279

280+
### Create Booking
281+
282+
The [booking-create.component.ts](https://github.com/NetCoreTemplates/angular-spa/blob/main/MyApp.Client/src/app/bookings/booking-create.component.ts) shows the standard pattern of calling ServiceStack Typed APIs to
283+
save forms whilst saving any validation errors to the `ApiState` context:
284+
285+
```ts
286+
async save(): Promise<void> {
287+
this.api.begin();
288+
289+
const request = new CreateBooking(this.booking());
290+
const api = await this.client.api(request);
291+
if (api.succeeded) {
292+
// Navigate back to bookings list after successful save
293+
this.router.navigate(['/bookings']);
294+
}
295+
296+
this.api.complete(api.error);
297+
}
298+
```
299+
300+
Where any contextual validation will be displayed next to the input field:
301+
302+
[![](/img/pages/templates/angular-spa/angular-booking-create-validation.webp)](https://angular-spa.web-templates.io/bookings/create)
303+
280304
### Edit Booking
281305

282306
The [booking-edit.component.ts](https://github.com/NetCoreTemplates/angular-spa/blob/main/MyApp.Client/src/app/bookings/booking-edit.component.ts)
Binary file not shown.

0 commit comments

Comments
 (0)