If you add Renderer
and ElementRef
to your component, you should then be able to access the element in question:
constructor(private renderer: Renderer, private elem: ElementRef){}
I believe from within your component you can call:
const elements = this.elem.nativeElement.querySelectorAll('button');
Which would give you the elements you need. It's important when using this method to ensure that you're running your code at some point after the component is initialised, not in the constructor as was the case with your original code, as we need to ensure we have access to the DOM for this component. This question has more detail.