# Angular html attributes

**URL:** <https://community.sonarsource.com/t/angular-html-attributes/61091>\
**Category:** Report False-positive / False-negative...\
**Tags:** html, sonarqube-ide, sonarqube\
**Created:** [April 5, 2022, 9:35am UTC](https://community.sonarsource.com/t/angular-html-attributes/61091 "2022-04-05T09:35:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![empouras](https://avatars.discourse-cdn.com/v4/letter/e/50afbb/32.png) [@empouras](https://community.sonarsource.com/u/empouras)\
**Post date:** [April 5, 2022, 9:35am UTC](https://community.sonarsource.com/t/angular-html-attributes/61091/1 "2022-04-05T09:35:33Z")

</div>

There seems to be an issue in both sonarlint and sonarqube when it comes to Angular and attributes.  
In order to bind an attribute with angular you need the prefix “attr.” in front of it but then the control thinks that the attribute is actually missing. Can we do something about this?

SonarQube version: Developer Edition 9.3.0.51899  
SonarLint version: 6.0.0.45402

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/4/9/49db3c847f65b8b811775a40ed8ae290e08146e1.png)  
 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/c/b/cbe67c4fa4aae1e6c51e385ee0af4c4af369636c.png)

Fyi: @Rahul_Mahulkar

---

<div class="post-metadata">

**Author:** ![Rahul\_Mahulkar](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rahul_mahulkar/32/19537_2.png) [@Rahul\_Mahulkar](https://community.sonarsource.com/u/Rahul_Mahulkar)\
**Post date:** [April 14, 2022, 7:53am UTC](https://community.sonarsource.com/t/angular-html-attributes/61091/5 "2022-04-14T07:53:48Z")

</div>

Hi @ganncamp, Apologies to tag you again. But you are the one who always responds.  
Could you please help here? At least someone takes first look.

Regards  
Rahul Mahulkar

---

<div class="post-metadata">

**Author:** ![Karim\_El\_Ouerghemmi](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/karim_el_ouerghemmi/32/12764_2.png) [@Karim\_El\_Ouerghemmi](https://community.sonarsource.com/u/Karim_El_Ouerghemmi)\
**Post date:** [April 19, 2022, 10:01am UTC](https://community.sonarsource.com/t/angular-html-attributes/61091/6 "2022-04-19T10:01:20Z")

</div>

Hello @empouras and @Rahul_Mahulkar,

Excuses for the delayed response on this.

You are right. This can lead to wrong issues in some rules.

We did add a fix some time ago to catch the `[attr.foo]=...` cases ([SONARHTML-118](https://jira.sonarsource.com/browse/SONARHTML-118)), but did miss that there is also a syntax without the brackets. I did create [SONARHTML-158](https://jira.sonarsource.com/browse/SONARHTML-158) to handle this in the next release (not planned yet).

Thank you for reporting this!

Best,  
Karim.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/78532_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [May 6, 2022, 8:28am UTC](https://community.sonarsource.com/t/angular-html-attributes/61091/7 "2022-05-06T08:28:06Z")

</div>

Closed on May 6, 2022, 8:28am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
