import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-first', templateUrl: './first.component.html', styleUrls: ['./first.component.css'] }) export class FirstComponent implements OnInit { employees!: Employee[]; selected!: string; constructor() { } ngOnInit(): void { this.employees = [ { name: "Parke Béla", salary: 2850000 }, { name: "Lenke Attila", salary: 2243500 }, { name: "Tron Ferenc", salary: 2150500 } ] } onClickEmployee(employee: Employee) { this.selected = employee.name; } } interface Employee { name: string, salary: number }