import { Component, ViewChild, Input, OnInit } from '@angular/core';
import  {DatePipe} from '@angular/common'
import { Observable } from 'rxjs';
import { GridDataResult, GridComponent, PageChangeEvent } from '@progress/kendo-angular-grid';

//import { ProductsService } from './northwind.service';
import { trasnactions } from '../../transaction-list/employees';
import { transform } from '@progress/kendo-drawing/dist/npm/geometry';

@Component({
  selector: 'trans-tails',
  templateUrl: './trans-tails.component.html',
  styleUrls: ['./trans-tails.component.scss']
})
export class TransTailsComponent implements OnInit {

    /**
     * The category for which details are displayed
     */
    @Input() public item : Object;
    public tailsView: any[];

    //public view: Observable<GridDataResult>;
    public skip = 0;

    constructor() { }

    public ngOnInit(): void {
        //this.view = this.service;
        this.tailsView = trasnactions;//.slice(this.skip, this.skip + 5);
        /*load products for the given category*/
        //this.service.queryForCategory(this.item, { skip: this.skip, take: 5 });
    }

    public pageChange({ skip, take }: PageChangeEvent): void {
        this.skip = skip;
        //this.service.queryForCategory(this.item, { skip, take });
        this.tailsView = trasnactions.slice(skip, skip + take);
    }

}
