I have a Component, where we want to Input an HTML attribute.
However if No value is provided for input, I do Not want even display the attribute in html. How can this be done? Right now it shows as "".
export class ProductComponent implements OnInit {
@Input dataQA: string;
HTML:
<div class="productTitle"
data-qa="dataQA"
>
Note: I want to keep the Whole Div, just exclude the attribute within the div. I may have multiple attributes future within the div, so looking for efficient solution.