-
-
-
-
-
+
+
+ ID:
+
+
+
+ From:
+
+
+
+ To:
+
+
+
+ Date:
+
+
+
+ Delayed
+
-
-
-
-
+
+
+
+
}
diff --git a/apps/demo/src/app/flight-search-data-service-simple/flight-edit-simple.component.ts b/apps/demo/src/app/flight-search-data-service-simple/flight-edit-simple.component.ts
index 4a8177ea..96a132cb 100644
--- a/apps/demo/src/app/flight-search-data-service-simple/flight-edit-simple.component.ts
+++ b/apps/demo/src/app/flight-search-data-service-simple/flight-edit-simple.component.ts
@@ -1,34 +1,53 @@
-import { CommonModule } from '@angular/common';
-import { Component, Input, OnInit, ViewChild, inject } from '@angular/core';
+import { Component, OnInit, inject, input, viewChild } from '@angular/core';
import { FormsModule, NgForm } from '@angular/forms';
+import { MatButtonModule } from '@angular/material/button';
+import { MatCheckboxModule } from '@angular/material/checkbox';
+import { MatFormFieldModule } from '@angular/material/form-field';
+import { MatInputModule } from '@angular/material/input';
import { RouterModule } from '@angular/router';
import { Flight } from '../shared/flight';
import { SimpleFlightBookingStore } from './flight-booking-simple.store';
@Component({
- imports: [CommonModule, RouterModule, FormsModule],
+ imports: [
+ RouterModule,
+ FormsModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatCheckboxModule,
+ MatButtonModule,
+ ],
selector: 'demo-flight-edit-simple',
templateUrl: './flight-edit-simple.component.html',
+ styles: `
+ #fields {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ }
+ #buttons {
+ display: flex;
+ gap: 5px;
+ }
+ `,
})
export class FlightEditSimpleComponent implements OnInit {
- @ViewChild(NgForm)
- private form!: NgForm;
-
private store = inject(SimpleFlightBookingStore);
+ private readonly form = viewChild.required(NgForm);
+
current = this.store.current;
loading = this.store.loading;
error = this.store.error;
- @Input({ required: true })
- id = '';
+ readonly id = input.required
();
ngOnInit(): void {
- this.store.loadById(this.id);
+ this.store.loadById(this.id());
}
async save() {
- const flight = this.form.value as Flight;
+ const flight = this.form().value as Flight;
if (flight.id) {
await this.store.update(flight);
} else {
@@ -41,6 +60,6 @@ export class FlightEditSimpleComponent implements OnInit {
}
async deleteFlight() {
- await this.store.delete(this.form.value);
+ await this.store.delete(this.form().value);
}
}
diff --git a/apps/demo/src/app/flight-search-data-service-simple/flight-search-simple.component.html b/apps/demo/src/app/flight-search-data-service-simple/flight-search-simple.component.html
index 130a6fa7..19c81fa7 100644
--- a/apps/demo/src/app/flight-search-data-service-simple/flight-search-simple.component.html
+++ b/apps/demo/src/app/flight-search-data-service-simple/flight-search-simple.component.html
@@ -1,75 +1,89 @@
Flight Search (Simple)
-
- Loading ...
+ @if (loading()) {
+ Loading...
+ }
+ }
{{ selected() | json }}
diff --git a/apps/demo/src/app/flight-search-data-service-simple/flight-search-simple.component.ts b/apps/demo/src/app/flight-search-data-service-simple/flight-search-simple.component.ts
index 1670419d..89dfd4c6 100644
--- a/apps/demo/src/app/flight-search-data-service-simple/flight-search-simple.component.ts
+++ b/apps/demo/src/app/flight-search-data-service-simple/flight-search-simple.component.ts
@@ -1,7 +1,8 @@
-import { JsonPipe, NgForOf, NgIf } from '@angular/common';
+import { JsonPipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
+import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatTableModule } from '@angular/material/table';
import { RouterLink } from '@angular/router';
@@ -10,8 +11,6 @@ import { SimpleFlightBookingStore } from './flight-booking-simple.store';
@Component({
imports: [
- NgIf,
- NgForOf,
JsonPipe,
FormsModule,
FlightCardComponent,
@@ -19,6 +18,7 @@ import { SimpleFlightBookingStore } from './flight-booking-simple.store';
MatInputModule,
MatButtonModule,
RouterLink,
+ MatFormFieldModule,
],
selector: 'demo-flight-search',
templateUrl: './flight-search-simple.component.html',
diff --git a/apps/demo/src/app/flight-search-redux-connector/flight-search.component.html b/apps/demo/src/app/flight-search-redux-connector/flight-search.component.html
index 2ec452e6..c6de50e9 100644
--- a/apps/demo/src/app/flight-search-redux-connector/flight-search.component.html
+++ b/apps/demo/src/app/flight-search-redux-connector/flight-search.component.html
@@ -2,27 +2,29 @@
Flight Search (Redux Connector)
@@ -47,8 +58,7 @@
Flight Search (Redux Connector)
[item]="flight"
[selected]="localState.basket()[flight.id]"
(selectedChange)="select(flight.id, $event)"
- >
-
+ />
}
diff --git a/apps/demo/src/app/flight-search-redux-connector/flight-search.component.ts b/apps/demo/src/app/flight-search-redux-connector/flight-search.component.ts
index 32aed7dc..70840e59 100644
--- a/apps/demo/src/app/flight-search-redux-connector/flight-search.component.ts
+++ b/apps/demo/src/app/flight-search-redux-connector/flight-search.component.ts
@@ -1,6 +1,9 @@
import { JsonPipe } from '@angular/common';
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
+import { MatButtonModule } from '@angular/material/button';
+import { MatFormFieldModule } from '@angular/material/form-field';
+import { MatInputModule } from '@angular/material/input';
import { patchState, signalState } from '@ngrx/signals';
import { Flight } from '../shared/flight';
import { FlightCardComponent } from '../shared/flight-card.component';
@@ -9,7 +12,14 @@ import { ticketActions } from './+state/actions';
import { injectFlightStore } from './+state/redux';
@Component({
- imports: [JsonPipe, FormsModule, FlightCardComponent],
+ imports: [
+ JsonPipe,
+ FormsModule,
+ FlightCardComponent,
+ MatInputModule,
+ MatButtonModule,
+ MatFormFieldModule,
+ ],
selector: 'demo-flight-search-redux-connector',
templateUrl: './flight-search.component.html',
})
diff --git a/apps/demo/src/app/flight-search-with-pagination/flight-search-with-pagination.component.html b/apps/demo/src/app/flight-search-with-pagination/flight-search-with-pagination.component.html
index 67e78d54..d343c3f8 100644
--- a/apps/demo/src/app/flight-search-with-pagination/flight-search-with-pagination.component.html
+++ b/apps/demo/src/app/flight-search-with-pagination/flight-search-with-pagination.component.html
@@ -49,11 +49,11 @@