I trying to use NGB Pagination on my angular app in a table. But when i use pipe slice in my *ngFor, my Angular appear error TS2571: Object is of type 'unknown' when try slice. This is my code:
- My HTML code:
<tr *ngFor="let row of documentaryList|slice: (page-1) * pageSize : page * pageSize" class="text-md text-md-center">
<td>{{ row.documentDate }}</td>
<td><a class="text-info" routerLink="details-documentary/{{row._id}}">{{ row.documentName }}</a></td>
<td>{{ row.documentNumber }}</td>
<td>{{ row.documentType }}</td>
<td>{{ row.documentAddress }}</td>
<td>
- My .ts code:
export class ListDocumentaryComponent implements OnInit {
title = 'Documentary';
documentaryList: any;
page = 1;
pageSize = 10;
lengthDocumentList = 0;
constructor(private documentaryService: DocumentaryService) {
}
ngOnInit(): void {
this.getDocumentaryList();
}
getDocumentaryList(): any {
this.documentaryService.getDocumentary()
.subscribe((data: any) => {
this.documentaryList = data.data;
this.lengthDocumentList = this.documentaryList.length;
});
}
}
Thanks for your help!

