images based on http-server, filter dropdowns
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CommonModule, NgOptimizedImage } from '@angular/common';
|
||||
import { ChangeDetectorRef, Component } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
||||
@@ -23,7 +23,21 @@ import { getCriteriaStateObject, getSessionStorageHandler, resetCriteria } from
|
||||
@Component({
|
||||
selector: 'app-broker-listings',
|
||||
standalone: true,
|
||||
imports: [CommonModule, StyleClassModule, ButtonModule, CheckboxModule, InputTextModule, DropdownModule, FormsModule, StyleClassModule, ToggleButtonModule, RouterModule, PaginatorModule, InputGroupModule],
|
||||
imports: [
|
||||
CommonModule,
|
||||
StyleClassModule,
|
||||
ButtonModule,
|
||||
CheckboxModule,
|
||||
InputTextModule,
|
||||
DropdownModule,
|
||||
FormsModule,
|
||||
StyleClassModule,
|
||||
ToggleButtonModule,
|
||||
RouterModule,
|
||||
PaginatorModule,
|
||||
InputGroupModule,
|
||||
NgOptimizedImage,
|
||||
],
|
||||
templateUrl: './broker-listings.component.html',
|
||||
styleUrl: './broker-listings.component.scss',
|
||||
})
|
||||
@@ -59,7 +73,7 @@ export class BrokerListingsComponent {
|
||||
this.criteria = onChange(getCriteriaStateObject(), getSessionStorageHandler);
|
||||
this.criteria.type = undefined;
|
||||
this.route.data.subscribe(async () => {
|
||||
if (!this.router.getCurrentNavigation().extras.state) {
|
||||
if (this.router.getCurrentNavigation().extras.state) {
|
||||
resetCriteria(this.criteria);
|
||||
}
|
||||
this.init();
|
||||
@@ -67,7 +81,7 @@ export class BrokerListingsComponent {
|
||||
}
|
||||
async ngOnInit() {
|
||||
const statesResult = await this.listingsService.getAllStates('business');
|
||||
this.states = statesResult.map(s => s.state).map(ls => ({ name: this.selectOptions.getState(ls as string), value: ls }));
|
||||
this.states = statesResult.map(ls => ({ name: this.selectOptions.getState(ls.state as string), value: ls.state, count: ls.count }));
|
||||
}
|
||||
async init() {
|
||||
this.search();
|
||||
|
||||
Reference in New Issue
Block a user