Imitation of pressing a few buttons Angular 8?

When you click on the items button should open\closed
Made this code but it only works on one item . Elements are added dynamically

component
@ViewChild('loginButton.') loginButton.: ElementRef<HTMLElement>;

btnClick(){
console.log(this.loginButton..nativeElement);
 let el: HTMLElement = this.loginButton..nativeElement;
el.click();
}

.html
5e9901c3b9733687714464.png

looks like
5e99013eda4e4361192916.png
April 19th 20 at 12:27
1 answer
April 19th 20 at 12:29
Solution

Find more questions by tags Angular