Shared component: pro-image
This component has image element with id proImg
<img id="proImg" src="{{imgPath}}">
imgPath is @input variable.
This component is used in multiple components and each parent passes image path and image dimension to above shared component.
In this shared component.ts file, I'm trying to access <img> element by id to add some attributes to the element. But while access element by Id only last element is getting accessed.
I want to uniquely this image element each time its been used in other component similar to host selector. Please suggest how can I achieve.