Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <input
  2. type="text"
  3. name="search"
  4. class="search__input"
  5. placeholder="Search by Name..."
  6. [(ngModel)]="tableService.filter">
  7.  
  8. <ul class="table-body__list">
  9. <li *ngFor="let item of tableService.items | stringFilter: tableService.filter | paginate: config">
  10. <app-item [item]="item"></app-item>
  11. </li>
  12. </ul>
  13.  
  14. <pagination-controls
  15. [maxSize]="maxSize"
  16. directionLinks="true"
  17. responsive="true"
  18. previousLabel="Previous page"
  19. nextLabel="Next page"
  20. (pageChange)="onPageChange($event)">
  21. </pagination-controls>
  22.  
  23. import { Component, OnInit } from '@angular/core';
  24. import { PaginationInstance } from 'ngx-pagination';
  25. import { TableService } from '../../services/table.service';
  26. @Component({
  27. selector: 'app-jobs-table',
  28. templateUrl: './jobs-table.component.html',
  29. styleUrls: ['./jobs-table.component.scss']
  30. })
  31. export class JobsTableComponent implements OnInit {
  32. filter = '';
  33. maxSize = 9;
  34. config: PaginationInstance = {
  35. itemsPerPage: 11,
  36. currentPage: 1
  37. };
  38.  
  39. constructor(public tableService: TableService) { }
  40.  
  41. ngOnInit() {
  42. }
  43.  
  44. onPageChange(number: number) {
  45. this.config.currentPage = number;
  46. }
  47.  
  48. }
  49.  
  50. filter = '';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement