Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input
- type="text"
- name="search"
- class="search__input"
- placeholder="Search by Name..."
- [(ngModel)]="tableService.filter">
- <ul class="table-body__list">
- <li *ngFor="let item of tableService.items | stringFilter: tableService.filter | paginate: config">
- <app-item [item]="item"></app-item>
- </li>
- </ul>
- <pagination-controls
- [maxSize]="maxSize"
- directionLinks="true"
- responsive="true"
- previousLabel="Previous page"
- nextLabel="Next page"
- (pageChange)="onPageChange($event)">
- </pagination-controls>
- import { Component, OnInit } from '@angular/core';
- import { PaginationInstance } from 'ngx-pagination';
- import { TableService } from '../../services/table.service';
- @Component({
- selector: 'app-jobs-table',
- templateUrl: './jobs-table.component.html',
- styleUrls: ['./jobs-table.component.scss']
- })
- export class JobsTableComponent implements OnInit {
- filter = '';
- maxSize = 9;
- config: PaginationInstance = {
- itemsPerPage: 11,
- currentPage: 1
- };
- constructor(public tableService: TableService) { }
- ngOnInit() {
- }
- onPageChange(number: number) {
- this.config.currentPage = number;
- }
- }
- filter = '';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement