I am watching for my radio buttons with :
@ViewChildren('radioButton') radioButton: QueryList<MatRadioButton>;
Later I want to get the first and make it checked :
public clickEmitFirst() {
this.radioButton.forEach((radio,index) => {
console.log(index);
radio.checked = true;
this.clickEvent.emit({ id: this.parentId, item: this.item });
});
}
The problem is that index is always 0 (3 console logs with 0)
How to fix that ?