I have on array of years links like this:

```
<div class="header-years-container default-color">
              <a class="years-items"  *ngFor="let year of yearsLink;" [ngClass]="{'active': selectedYear === year}" (click)="onSelectYear($event.target.innerText)">
                  {{ year }}
                </a>
            </div>

```

and one property that show data for selectedYear. In ngOnInit method I set default value from array but I want to pass other value of year when user click on that. In Typescript looks this:

```
ngOnInit() {
    this.yearsLink = [...new Set(this.absenceWidgetService.getAbsencesData().map(item => item.year))];
    this.selectedYear = this.yearsLink[0];

    this.selectedYear = this.onSelectYear(this.selectedYear);
    this.absences = this.absenceWidgetService.getAbsencesData(this.selectedYear)
  }

onSelectYear(value): string {
    return this.selectedYear = value;
  }

```

How can I pass each time correct value for selectedYear in getAbsenceData method when user do click event ? Currently I always have default value..

Thanks.