@@ -22,11 +22,11 @@ import { ModalService } from './modal.service';
|
||||
styleUrl: './search-modal.component.scss',
|
||||
})
|
||||
export class SearchModalComponent {
|
||||
cities$: Observable<GeoResult[]>;
|
||||
// cities$: Observable<GeoResult[]>;
|
||||
counties$: Observable<CountyResult[]>;
|
||||
cityLoading = false;
|
||||
// cityLoading = false;
|
||||
countyLoading = false;
|
||||
cityInput$ = new Subject<string>();
|
||||
// cityInput$ = new Subject<string>();
|
||||
countyInput$ = new Subject<string>();
|
||||
private criteriaChangeSubscription: Subscription;
|
||||
public criteria: BusinessListingCriteria | CommercialPropertyListingCriteria | UserListingCriteria;
|
||||
@@ -54,7 +54,7 @@ export class SearchModalComponent {
|
||||
this.criteria.start = 0;
|
||||
}
|
||||
});
|
||||
this.loadCities();
|
||||
// this.loadCities();
|
||||
this.loadCounties();
|
||||
}
|
||||
|
||||
@@ -71,22 +71,22 @@ export class SearchModalComponent {
|
||||
}
|
||||
}
|
||||
}
|
||||
private loadCities() {
|
||||
this.cities$ = concat(
|
||||
of([]), // default items
|
||||
this.cityInput$.pipe(
|
||||
distinctUntilChanged(),
|
||||
tap(() => (this.cityLoading = true)),
|
||||
switchMap(term =>
|
||||
this.geoService.findCitiesStartingWith(term).pipe(
|
||||
catchError(() => of([])), // empty list on error
|
||||
// map(cities => cities.map(city => city.city)), // transform the list of objects to a list of city names
|
||||
tap(() => (this.cityLoading = false)),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
// private loadCities() {
|
||||
// this.cities$ = concat(
|
||||
// of([]), // default items
|
||||
// this.cityInput$.pipe(
|
||||
// distinctUntilChanged(),
|
||||
// tap(() => (this.cityLoading = true)),
|
||||
// switchMap(term =>
|
||||
// this.geoService.findCitiesStartingWith(term).pipe(
|
||||
// catchError(() => of([])), // empty list on error
|
||||
// // map(cities => cities.map(city => city.city)), // transform the list of objects to a list of city names
|
||||
// tap(() => (this.cityLoading = false)),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
private loadCounties() {
|
||||
this.counties$ = concat(
|
||||
of([]), // default items
|
||||
|
||||
Reference in New Issue
Block a user