import { Component, OnInit } from '@angular/core';
import { ListService } from '@core/services/list/list.service';

@Component({
  selector: 'app-fixed-assets',
  templateUrl: './fixed-assets.component.html',
  styleUrls: ['./fixed-assets.component.less'],
})
export class FixedAssetsComponent implements OnInit {
  list: any[] = [];
  loading = true;
  q: any = {
    pi: 1,
    ps: 10,
    sorter: '',
    status: null,
    statusList: [],
  };
  expandForm = false;
  constructor(private listSrv: ListService) {}

  ngOnInit() {
    this.loading = true;
    this.listSrv.getKindAssetList(2).subscribe(res => {
      this.list = res['rows'];
      console.log(this.list);
      this.loading = false;
    });

    // this.http.get('/api/list', { count: 8 }).subscribe((res: any) => {
    //   this.list = this.list.concat(res);
    //   this.loading = false;
    //   this.cdr.detectChanges();
    // });
  }
}
