I'm hoping to get the host template attributes, but this.template.host
is null.
e.g. something like:
connectedCallback() {
console.log(this.template.host.getAttribute('aria-describedby'));
}
In the rendered markup in the browser, my LWC looks like:
<c-my-lwc aria-describedby='a-value'>
[additional html content]
</c-my-lwc>
I'm hoping the console.log could output 'a-value'.
NOTE: this is a bit of an XY problem, but I don't see any other way of solving my problem.
I was looking at this question: Can an LWC component get its own name?
In this question, the answer refers to getting this.template.host.localName
, but given this.template.host
is null, I'm not sure how to do this.