You can access the nearest parent DOM element by looking at this.elRef.closestsome selectors corresponding to this parent element.
constructor(private elRef: ElementRef){}
ngOnInit() {
const parentElement = this.elRef.closest('.parent-element-class')
}
source
share