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

Pagination with http Data #24

Open
sluisTW-zz opened this issue Jun 13, 2018 · 0 comments
Open

Pagination with http Data #24

sluisTW-zz opened this issue Jun 13, 2018 · 0 comments

Comments

@sluisTW-zz
Copy link

sluisTW-zz commented Jun 13, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant