// Angular imports // import { Component, Input, HostListener, HostBinding } from '@angular/core'; // Components // import { FbTableComponent } from './fb-table.component'; // Services // // Directives // /** * @param by Parameternamn som skall sorteras efter då man klickar på kolumnen */ @Component({ selector: 'fb-sort-column', templateUrl: './fb-sort-column.component.html', }) export class FbSortColumnComponent { @Input() by: string; @HostBinding('class.sort-by') sortByClass: boolean = true; @HostBinding('style.display') display: string = 'block'; @HostBinding('style.cursor') cursorStyle: string = 'pointer'; constructor ( readonly table: FbTableComponent ) {} @HostListener('click', ['$event']) onclick(): void { this.table.setOrder(this.by); } }