search function for show editing

This commit is contained in:
2020-04-21 18:43:08 +02:00
committed by smuddy
parent 5695640fe4
commit c526f127e8
10 changed files with 73 additions and 35 deletions

View File

@@ -10,6 +10,8 @@ import {MatSelectChange} from '@angular/material/select';
import {ShowSongService} from '../services/show-song.service';
import {ShowSong} from '../services/showSong';
import {DocxService} from '../services/docx.service';
import {FormControl} from '@angular/forms';
import {filterSong} from '../../../services/filter.helper';
@Component({
selector: 'app-show',
@@ -89,4 +91,11 @@ export class ShowComponent implements OnInit {
public async onDownload(): Promise<void> {
await this.docxService.create(this.showId);
}
public filteredSongsControl = new FormControl();
filteredSongs() {
const filterValue = this.filteredSongsControl.value;
return filterValue ? this.songs.filter(_ => filterSong(_, filterValue)) : this.songs;
}
}