Files
Bridge-Multi/src-angular/app/components/browse/result-table/result-table-row/result-table-row.component.ts
2023-12-25 10:29:57 -06:00

30 lines
815 B
TypeScript

import { Component, Input, OnInit } from '@angular/core'
import { ChartData } from '../../../../../../src-shared/interfaces/search.interface'
import { SelectionService } from '../../../../core/services/selection.service'
@Component({
selector: 'tr[app-result-table-row]',
templateUrl: './result-table-row.component.html',
})
export class ResultTableRowComponent implements OnInit {
@Input() song: ChartData[]
constructor(private selectionService: SelectionService) { }
ngOnInit() {
this.selectionService.selections[this.groupId] = this.selectionService.isAllSelected()
}
get groupId() {
return this.song[0].groupId
}
get selected() {
return this.selectionService.selections[this.groupId] ?? false
}
set selected(value: boolean) {
this.selectionService.selections[this.groupId] = value
}
}