If you need a selector, this is a great way to get it.
constructor(public elementRef: ElementRef<any>) {}
...
const nodeName = this.elementRef.nativeElement.nodeName.toLowerCase();
...
I have a component that can be declared as an element or as an attribute. This approach lets me know if the host element is a div element (when my component is an attribute) or my component selector.
source
share