Skip to content

Commit 90a01b3

Browse files
committed
temp
1 parent 263ce62 commit 90a01b3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/components-examples/material/autocomplete/autocomplete-loading/autocomplete-loading-example.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {AsyncPipe} from '@angular/common';
2-
import {Component} from '@angular/core';
2+
import {Component, signal} from '@angular/core';
33
import {FormControl, ReactiveFormsModule} from '@angular/forms';
44
import {MatAutocompleteModule} from '@angular/material/autocomplete';
55
import {MatFormFieldModule} from '@angular/material/form-field';
@@ -24,14 +24,14 @@ export class AutocompleteLoadingExample {
2424
myControl = new FormControl('');
2525
options = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California'];
2626
filteredOptions: Observable<string[]>;
27-
isLoading = true;
27+
isLoading = signal(true);
2828

2929
constructor() {
3030
this.filteredOptions = this.myControl.valueChanges.pipe(
3131
startWith(''),
3232
switchMap(value => {
33-
this.isLoading = true;
34-
return this._filter(value || '').pipe(finalize(() => (this.isLoading = false)));
33+
this.isLoading.set(true);
34+
return this._filter(value || '').pipe(finalize(() => this.isLoading.set(false)));
3535
}),
3636
);
3737
}
@@ -43,4 +43,4 @@ export class AutocompleteLoadingExample {
4343
// Simulate an asynchronous request.
4444
return of(results).pipe(delay(500));
4545
}
46-
}
46+
}

0 commit comments

Comments
 (0)