import {Component, OnInit, TemplateRef, ViewChild} from '@angular/core';
import {Dialog} from '../../../classes/dialog';
import {ListComponent} from '../../../classes/base_components/list/list.component';
import {TypesService} from './types.service';
import {EditTypesComponent} from './edit-types/edit-types.component';
import {Http} from '@angular/http';
import {GlobalService} from '../../../classes/global.service';


@Component({
  selector: 'app-type',
  templateUrl: './types.component.html',
  styleUrls: ['./types.component.scss']
})
export class TypesComponent extends ListComponent implements OnInit{
    @ViewChild('filter_id') public filter_id_ref: TemplateRef<any>;
    @ViewChild('filter_name') public filter_name_ref: TemplateRef<any>;
  constructor(
    protected listService: TypesService,
    protected dialog: Dialog,
    protected http: Http,

  ) {
    super(listService, dialog, EditTypesComponent , http );
  }
    ngOnInit() {
    this.columns = [

        {
            prop: 'name',
            name: 'نام',
            filter: this.filter_name_ref,
        },
      {
        prop: 'id',
        name: 'شناسه',
        filter: this.filter_id_ref,
      },

    ];
        super.ngOnInit();
    }

}
