Specify the columns at the specific component

This commit is contained in:
Norbi Peti 2022-01-21 17:10:36 +01:00
parent fc995858e6
commit 79fb876da8
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
2 changed files with 5 additions and 5 deletions

View file

@ -12,13 +12,10 @@ export class ListComponent<T> implements OnInit {
@Input() apiPath: string;
@Input() itemType: Type<T>;
@Input() columns: {title: string, prop: keyof T}[];
paginationData: PaginationData = {};
items: T[] = [];
columns: { title: string, prop: string }[] = [
{title: 'Név', prop: 'name'},
{title: 'Admin', prop: 'isAdmin'}
];
loading = false;
constructor(private api: ApiService) {

View file

@ -1 +1,4 @@
<app-list apiPath="/users" [itemType]="itemType"></app-list>
<app-list apiPath="/users" [itemType]="itemType" [columns]="[
{title: 'Név', prop: 'name'},
{title: 'Admin', prop: 'isAdmin'}
]"></app-list>