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; } }