aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-list/need-list.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ufund-ui/src/app/components/need-list/need-list.component.ts')
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.ts12
1 files changed, 1 insertions, 11 deletions
diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts
index d027690..cd7debb 100644
--- a/ufund-ui/src/app/components/need-list/need-list.component.ts
+++ b/ufund-ui/src/app/components/need-list/need-list.component.ts
@@ -11,10 +11,10 @@ import {Observable} from 'rxjs';
export class NeedListComponent implements OnChanges {
@Input({required: true}) needs!: Need[]
+ @Input() itemsPerPage: number = 5;
visibleNeeds: Need[] = [];
currentPage: number = 0;
- itemsPerPage: number = 5;
totalPages: number = 0;
constructor(
@@ -45,19 +45,9 @@ export class NeedListComponent implements OnChanges {
this.updateVisibleNeeds()
}
- editNeedsPerPage(amount: number) {
- this.itemsPerPage = amount;
- this.updateVisibleNeeds();
- }
-
updateVisibleNeeds() {
this.totalPages = Math.ceil(this.needs.length / this.itemsPerPage);
this.visibleNeeds = this.needs.slice(this.currentPage * this.itemsPerPage, (this.currentPage + 1) * this.itemsPerPage);
}
-
- resetVisibleNeeds() {
- this.currentPage = 0;
- this.updateVisibleNeeds();
- }
}