|
| 1 | +import { Component, OnInit } from '@angular/core'; |
| 2 | +import { Company, data } from '../../../assets/data'; |
| 3 | +import { Columns, Config, DefaultConfig } from 'ngx-easy-table'; |
| 4 | + |
| 5 | +@Component({ |
| 6 | + selector: 'app-column-class', |
| 7 | + templateUrl: './column-class.component.html', |
| 8 | + styleUrls: ['./column-class.component.scss'], |
| 9 | +}) |
| 10 | +export class ColumnClassComponent implements OnInit { |
| 11 | + public columns: Columns[]; |
| 12 | + public data: Company[] = []; |
| 13 | + public configuration: Config; |
| 14 | + |
| 15 | + ngOnInit(): void { |
| 16 | + this.configuration = DefaultConfig; |
| 17 | + this.configuration.searchEnabled = true; |
| 18 | + this.data = data; |
| 19 | + this.columns = [ |
| 20 | + { key: 'phone', title: 'Phone' }, |
| 21 | + { key: 'age', title: 'Age' }, |
| 22 | + { key: 'company', title: 'Company', cssClass: { includeHeader: false, name: 'blue' } }, |
| 23 | + { key: 'level', title: 'Level', cssClass: { includeHeader: true, name: 'pink' } }, |
| 24 | + { key: 'address.number', title: 'Number' }, |
| 25 | + { key: 'name', title: 'Name' }, |
| 26 | + { key: 'isActive', title: 'STATUS' }, |
| 27 | + ]; |
| 28 | + } |
| 29 | +} |
0 commit comments