import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-orders-all', templateUrl: './orders-all.component.html', styleUrls: ['./orders-all.component.scss'] }) export class OrdersAllComponent implements OnInit { cols: any; orders: any; pageSizeOptions: any; recordsCount = 10; totalRecords: number; constructor() { } ngOnInit() { this.getTableColums(); this.getTabledata(); // set records per page list this.pageSizeOptions = [ { label: 'View 05', value: 5 }, { label: 'View 10', value: 10 }, { label: 'View 15', value: 15 }, { label: 'View 20', value: 20 } ] } getTableColums() { this.cols = [ { field: 'OrderID', header: 'Order ID' }, { field: 'Customer', header: 'Customer' }, { field: 'Date', header: 'Date' }, { field: 'Status', header: 'Status' }, { field: 'Total', header: 'Total' } ]; } getTabledata() { this.orders = [ { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, { "OrderID": "Jhon", "Customer": "1994", "Date": "20", "Status": "Red", "Total": "Jhon" }, ] } }