Skip to content

Commit

Permalink
Update search.component.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
miladsoft committed Sep 19, 2024
1 parent 63d4581 commit 3dda731
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/app/layout/common/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { RouterLink } from '@angular/router';
import { angorAnimations } from '@angor/animations/public-api';
import { Subject, debounceTime, filter, map, takeUntil } from 'rxjs';
import { IndexedDBService } from 'app/services/indexed-db.service';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';

@Component({
selector: 'search',
Expand Down Expand Up @@ -78,7 +79,9 @@ export class SearchComponent implements OnChanges, OnInit, OnDestroy {
private _unsubscribeAll: Subject<any> = new Subject<any>();

constructor(
private _indexedDBService: IndexedDBService
private _indexedDBService: IndexedDBService,
private _sanitizer: DomSanitizer

) { }

@ViewChild('barSearchInput')
Expand Down Expand Up @@ -172,4 +175,11 @@ export class SearchComponent implements OnChanges, OnInit, OnDestroy {
trackByFn(index: number, item: any): any {
return item.id || index;
}

handleImageError(event: Event): void {
const target = event.target as HTMLImageElement;
target.onerror = null;
target.src = 'images/avatars/avatar-placeholder.png';
}

}

0 comments on commit 3dda731

Please sign in to comment.