main-page.component.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { Component } from '@angular/core';
  2. @Component({
  3. selector: 'app-main-page',
  4. templateUrl: './main-page.component.html',
  5. styleUrls: ['./main-page.component.css'],
  6. })
  7. export class MainPageComponent {
  8. songs: string[] = [
  9. 'Song 1',
  10. 'Song 2',
  11. 'Song 3',
  12. // Add more songs here
  13. ];
  14. searchQuery: string = '';
  15. information: string = '';
  16. get filteredSongs(): string[] {
  17. if (this.searchQuery.trim() === '') {
  18. return this.songs;
  19. } else {
  20. return this.songs.filter(song =>
  21. song.toLowerCase().includes(this.searchQuery.toLowerCase())
  22. );
  23. }
  24. }
  25. selectedSongInformation: string = '';
  26. // Other component methods and lifecycle hooks
  27. displaySongInformation(song: string): void {
  28. // Logic to fetch and set the song information based on the selected song
  29. // Replace the code below with your own implementation
  30. }
  31. download() {
  32. // Implement your download logic here
  33. }
  34. upload() {
  35. // Implement your upload logic here
  36. }
  37. generatePdf() {
  38. // Implement your PDF generation logic here
  39. }
  40. }