-
Notifications
You must be signed in to change notification settings - Fork 94
Description
Hi,
I'm using the component and it's working, except for the pagination.
Follow my component class:
import { DataTableResource } from "angular-4-data-table";
import { UserList } from "./../../models/userList";
import { Component, OnInit } from "";
import { UserService } from "../../services/user-service.services";
`
@component({
selector: "userList-cmp",
moduleId: module.id,
templateUrl: "userList.component.html",
providers: [UserService]
})
export class UserListComponent implements OnInit {
userList: Array = new Array();
itemResource: any;
userlistCount = 10;
`
constructor(private userService: UserService) {
console.log("construtor");
}
async ngOnInit() {
await this.getUsers();
}
private async getUsers() {
await this.userService.getUsers().subscribe(
res => {this.userList = res; this.itemResource = new DataTableResource(res); this.userlistCount = this.userList.length; }
);
}
}
`
HTML parameters:
<data-table [items]="userList" [itemCount]="userlistCount" [limit]="2">
Can you help me?