I have some list of items in my database which I am retrieving in form of an array.I am displaying these items as selectables on my page. On clicking a particular, I want to retrieve it's value ( I want to know which item was selected).
Here's the HTML Code :
<p>Year Wise Medical Records</p>
<div class="list-group " *ngFor="let year of years | async">
<a routerLink="records" routerLinkActive="active" >
<mdb-icon fas icon="table" class="mr-3"></mdb-icon>{{year.key}}</a>
</div>
Here's how I am retrieving from the database:
this.years=af.list('/years/'+this.name).snapshotChanges();
All the items in the list are being highlighted on selecting any of them. Can someone help me with highlighting only that item which has been selected and print that item value on console through typescript.