chore: update Angular cache and TypeScript build info files
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component, computed, effect, inject, signal, untracked } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, computed, effect, ElementRef, inject, signal, untracked, ViewChild } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import { YoutubeApiService } from '../../services/youtube-api.service';
|
||||
@@ -358,4 +358,39 @@ export class SearchComponent {
|
||||
setFilterTag(key: string) {
|
||||
this.filterTag.set(key);
|
||||
}
|
||||
|
||||
@ViewChild('searchInput') searchInput?: ElementRef<HTMLInputElement>;
|
||||
|
||||
onSearchEnter(event: Event) {
|
||||
const keyboardEvent = event as KeyboardEvent;
|
||||
keyboardEvent.preventDefault();
|
||||
const query = this.q().trim();
|
||||
if (query) {
|
||||
// Utiliser reloadSearch() pour effectuer une nouvelle recherche
|
||||
this.reloadSearch();
|
||||
this.closeSearchResults();
|
||||
// Retirer le focus de l'input
|
||||
if (this.searchInput) {
|
||||
this.searchInput.nativeElement.blur();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closeSearchResults() {
|
||||
// Cette méthode sera appelée pour fermer les résultats de recherche
|
||||
// Vous pouvez ajouter une logique supplémentaire si nécessaire
|
||||
// Par exemple, si vous avez un état pour afficher/cacher les résultats
|
||||
// this.showResults.set(false);
|
||||
}
|
||||
|
||||
onSearchInput(event: Event) {
|
||||
const input = event.target as HTMLInputElement;
|
||||
this.q.set(input.value);
|
||||
// Vous pouvez ajouter ici la logique de recherche au fur et à mesure si nécessaire
|
||||
}
|
||||
|
||||
performSearch(query: string) {
|
||||
// Cette méthode sera appelée pour effectuer la recherche
|
||||
// Vous pouvez ajouter ici la logique de recherche
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user