I add some HTML to the DOM dynamically. There are several hyperlinks with class someClass and different ids. And after I add them to template I add event listener to them so when I click them id is logging.
this.HTMLdiv = this.domSanitizer.bypassSecurityTrustHtml(this.HtmlString);
this.changeDetectorRef.detectChanges();
this.elementRef.nativeElement.querySelector('.someClass').addEventListener('click', (e) => console.log(e.path[1].id));
Problem is that this event listener is added only to first element.
How can I add it to all elements with class someClass?