fix standalone

This commit is contained in:
2025-01-05 09:55:54 +01:00
parent e3fa1678c2
commit 597e89ffb3
10 changed files with 37 additions and 74 deletions

View File

@@ -3,14 +3,9 @@
<mat-label>Lied hinzufügen...</mat-label>
<mat-select (selectionChange)="onAddSongSelectionChanged($event)">
<mat-option>
<ngx-mat-select-search
[formControl]="filteredSongsControl"
></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let song of filteredSongs()" [value]="song.id">{{
song.title
}}
<ngx-mat-select-search [formControl]="filteredSongsControl"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let song of filteredSongs()" [value]="song.id">{{ song.title }}</mat-option>
</mat-select>
</mat-form-field>
</div>

View File

@@ -1,19 +1,21 @@
import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
import {UntypedFormControl} from '@angular/forms';
import {ReactiveFormsModule, UntypedFormControl} from '@angular/forms';
import {filterSong} from '../../../services/filter.helper';
import {MatSelectChange} from '@angular/material/select';
import {MatFormField, MatLabel, MatOption, MatSelect, MatSelectChange} from '@angular/material/select';
import {Song} from '../../../modules/songs/services/song';
import {ShowSong} from '../../../modules/shows/services/show-song';
import {ShowSongService} from '../../../modules/shows/services/show-song.service';
import {Show} from '../../../modules/shows/services/show';
import {ShowService} from '../../../modules/shows/services/show.service';
import {NgForOf, NgIf} from '@angular/common';
import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
@Component({
selector: 'app-add-song',
templateUrl: './add-song.component.html',
styleUrls: ['./add-song.component.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [NgIf, MatFormField, MatSelect, MatOption, MatLabel, NgxMatSelectSearchModule, ReactiveFormsModule, NgForOf],
})
export class AddSongComponent {
@Input() public songs: Song[] | null = null;
@@ -22,8 +24,10 @@ export class AddSongComponent {
@Input() public addedLive = false;
public filteredSongsControl = new UntypedFormControl();
public constructor(private showSongService: ShowSongService, private showService: ShowService) {
}
public constructor(
private showSongService: ShowSongService,
private showService: ShowService
) {}
public filteredSongs(): Song[] {
if (!this.songs) return [];

View File

@@ -1,15 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {AddSongComponent} from './add-song.component';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatSelectModule} from '@angular/material/select';
import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
import {ReactiveFormsModule} from '@angular/forms';
@NgModule({
declarations: [AddSongComponent],
exports: [AddSongComponent],
imports: [CommonModule, MatFormFieldModule, MatSelectModule, NgxMatSelectSearchModule, ReactiveFormsModule],
})
export class AddSongModule {
}