I am fetching my users in the form of a JSONArray and I want to show the data of each user when clicked on their names. but I am not able to pass the user.id into the function.
<ng-container *ngFor = "let user of users" >
<button (onclick)="getdata(user.id)" mat-raised-button color="primary">{{user.name}}</button>
</ng-container>
ng-containeryou can put the*ngFordirective directly on yourbuttonelement.