Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix angular pagination demo for compatibility to ng16 for export to CSB #28563

Open
wants to merge 3 commits into
base: 24_2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
class="employees"
[ngClass]="pageSize === 4 ? 'employees--forth' : 'employees--six'"
>
@for (employee of pageEmployees; track employee.ID) {
<employee-card [employee]="employee"></employee-card>
}
<employee-card *ngFor="let employee of pageEmployees; trackBy: trackEmployee" [employee]="employee">
</employee-card>
</div>

<dx-pagination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class AppComponent {
showNavigationButtons = true;

pageIndex = 1;

pageSize = 4;

onPageIndexChange(val) {
Expand All @@ -52,6 +52,10 @@ export class AppComponent {
this.pageEmployees = this.employees.slice((this.pageIndex - 1) * this.pageSize, this.pageIndex * this.pageSize);
}

trackEmployee(index, employee) {
return employee.ID;
}

constructor(service: Service) {
this.employees = service.getEmployees();
this.itemCount = this.employees.length;
Expand Down
Loading