import { Component, EventEmitter, Input, Output } from '@angular/core';
import { UnitTreeAllOutput } from '../../entities/output/unitTreeAllOutput';

@Component({
    moduleId: module.id,
    selector: 'SubordinateUnits',
    templateUrl: './subordinate-units.component.html',
    styleUrls: ['./subordinate-units.component.scss']
})
export class SubordinateUnitsComponent {
    @Input() unitTree: UnitTreeAllOutput[];
    @Output() itemTap = new EventEmitter<number>();

    onItemTap(index: number) {
        this.itemTap.emit(this.unitTree[index].ID_Unit);
    }

}
