import { Component, OnInit, Input, AfterContentInit, ContentChildren, Type,
    ContentChild, OnChanges, HostBinding, QueryList, ViewEncapsulation } from '@angular/core';
import { Bs4TableCell } from './bs4-table-cell';



const id = 'bs4-table-row';

@Component({
    selector: id,
    template: require(`./${id}.component.html`),
    styles: [require(`./${id}.component.scss`)]
})
export class Bs4TableRow implements OnInit, AfterContentInit {

    @ContentChildren(Bs4TableCell) cels: QueryList<Bs4TableCell>;
    @Input() data;

    constructor() {

    }

    ngOnInit() {
    }

    ngAfterContentInit() {
    }

    toArray(o: Object): string[] {
        let a = [];
        for (let i in o) {
            if (o.hasOwnProperty(i)) {
                a.push(o[i] === undefined ? '-' : o[i]);
            }
        }
        return a;
    }

    isArray(o: any) {
        return (o instanceof Array);
    }


}
