我有一个来自观察者的异步for循环,它是一个数组的对象。我想知道如何在单击按钮时从该数组中获取值?
数组的对象是这样的:{topic:[" first choice"," second choice"," third choice" ]}
<button *ngFor = "let choice of (choices | async)?.Topics">
{{question}}
答案 0 :(得分:1)
<button *ngFor = "let choice of (choices | async)?.Topics"
(click)="clickHandler(choice)">