Newer
Older
import { Component, Input, ChangeDetectionStrategy, Output, EventEmitter } from '@angular/core';
import { SearchMeta } from '../store/model';
import { Attribute } from 'src/app/metamodel/model';
@Component({
selector: 'app-datatable',
templateUrl: 'datatable.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DatatableComponent {
@Input() searchMeta: SearchMeta;
@Input() searchData: any[];
@Output() initSearchMeta: EventEmitter<{}> = new EventEmitter();
@Output() getSearchData: EventEmitter<number> = new EventEmitter();
this.initSearchMeta.emit();
this.getSearchData.emit(1);
}
getAttributeRenderer(attributeName: string): string {
const attribute = this.datasetAttributeList.find(attribute => attribute.name === attributeName);
return attribute.renderer;
}
getAttributeUriAction(attributeName: string, datum: string): string {
const attribute = this.datasetAttributeList.find(attribute => attribute.name === attributeName);
// return attribute.uri_action + datum;
return attribute.uri_action;
}