Reputation: 1532
I have an async for loop from an observalble which is an object of an array. I want to know how can I get the value out of this array when the button is clicked?
The object of array is like this: { topics: [ "first choice", "second choice", "third choice" ] }
<button *ngFor = "let choice of (choices | async)?.Topics">
{{question}}
Upvotes: 1
Views: 978
Reputation: 657761
<button *ngFor = "let choice of (choices | async)?.Topics"
(click)="clickHandler(choice)">
Upvotes: 1