How to bind dynamic data to aria-label with Angular?

Spread the love

To bind dynamic data to aria-label with Angular, we use square brackets.

For instance, we write

<div [attr.aria-label]="productDetails?.productName"></div>

to bind the aria-label attribnute to the value of the productDetails?.productName property.

Leave a Reply

Your email address will not be published. Required fields are marked *