position-unit.component.ts 979 Bytes
Newer Older
Natthaphat Pankiang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import { Component, EventEmitter, Input, Output } from '@angular/core';

@Component({
  selector: 'app-position-unit',
  templateUrl: './position-unit.component.html',
  styleUrls: ['./position-unit.component.scss']
})
export class PositionUnitComponent {
  @Input() pathTitle = ['การจัดการข้อมูลองค์กร', 'ทะเบียนบริษัท', 'สาขาและหน่วยธุรกิจ']
  @Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
  activeTab: string = 'tab1'; // กำหนด tab เริ่มต้น

  // ฟังก์ชันในการเปลี่ยนแท็บ
  changeTab(tab: { id: string, text: string }) {
    this.sendPathTitle.emit(['การจัดการข้อมูลองค์กร', 'ทะเบียนบริษัท', 'สาขาและหน่วยธุรกิจ', tab.text])
    this.activeTab = tab.id;
  }
}