Wording und API
This commit is contained in:
@@ -10,7 +10,7 @@ import { MAT_DATE_LOCALE, provideNativeDateAdapter } from '@angular/material/cor
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { AsyncPipe, DatePipe } from '@angular/common';
|
||||
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { map, Observable, startWith, timestamp } from 'rxjs';
|
||||
import { from, map, Observable, startWith, timestamp } from 'rxjs';
|
||||
import {
|
||||
MatBottomSheet,
|
||||
MatBottomSheetModule,
|
||||
@@ -99,7 +99,7 @@ export class HandoverDialogComponent {
|
||||
this.isLoading = true;
|
||||
const promises: Observable<any>[] = [
|
||||
this.getHandovers(),
|
||||
this.loadCustomers()
|
||||
from(this.loadCustomers())
|
||||
];
|
||||
|
||||
Promise.all(promises).then(() => {
|
||||
@@ -125,20 +125,17 @@ export class HandoverDialogComponent {
|
||||
}
|
||||
|
||||
loadCustomers() {
|
||||
const promise = this.api.getCustomers()
|
||||
|
||||
promise.subscribe({
|
||||
next: customers => {
|
||||
this.customers = customers;
|
||||
this.filteredCustomers = this.handoverForm.controls.customer.valueChanges.pipe(
|
||||
|
||||
|
||||
return new Promise(async resolve => {
|
||||
const customers = await this.api.getCustomers();
|
||||
this.customers = customers;
|
||||
this.filteredCustomers = this.handoverForm.controls.customer.valueChanges.pipe(
|
||||
startWith(''),
|
||||
map(value => this._filter(value || '')),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
return promise;
|
||||
|
||||
);
|
||||
resolve(customers)
|
||||
});
|
||||
}
|
||||
|
||||
private _filter(value: string): any[] {
|
||||
|
||||
Reference in New Issue
Block a user