Specify the columns at the specific component
This commit is contained in:
parent
fc995858e6
commit
79fb876da8
2 changed files with 5 additions and 5 deletions
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue