Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchAngular’s NG8104 warning means a template uses an attr., style., or class. prefix without square-bracket binding syntax. If you meant to bind a value, put brackets around the full name—for example, change attr.id="myId" to [attr.id]="myId". Without brackets, Angular treats the text as a regular attribute, not as the intended binding.
What NG8104 means
Angular checks for text attributes that start with the special prefixes attr., style., or class. but are not written as bindings. A template such as <div attr.id="my-id"></div> can produce an attribute literally named attr.id; it does not set the element’s id through Angular’s attribute-binding syntax. Angular documents this diagnostic as a check that these prefixed names are interpreted as bindings: NG8104: Text attribute not binding.
As an Amazon Associate I earn from qualifying purchases.
How to fix NG8104
Use square brackets around the complete binding name. The value in quotation marks is then an Angular expression.
| Intended binding | Correct syntax |
|---|---|
| Set an attribute | <div [attr.id]="myId"></div> |
| Set a style property | <div [style.color]="colorValue"></div> |
| Toggle a class | <div [class.large]="isLarge"></div> |
Replace the example expressions with the component value or state you want Angular to use. Keep the brackets around the prefixed name; quoting an expression without brackets leaves it as a plain text attribute.
#1 Best Overall
Why the diagnostic appears—or does not
NG8104 is an Angular extended diagnostic. Angular states that strictTemplates must be enabled for any extended diagnostic to emit, and that textAttributeNotBinding has no additional requirements. If the warning is absent, that alone does not prove the template syntax is correct; the extended-diagnostics prerequisite may not be enabled. See Angular’s NG8104 documentation.
Suppressing the warning
If you deliberately need to silence this check, Angular documents the following setting in tsconfig.json:
Rank #2
{
"angularCompilerOptions": {
"extendedDiagnostics": {
"checks": {
"textAttributeNotBinding": "suppress"
}
}
}
}
Suppression disables NG8104; it does not turn a plain text attribute into an Angular binding. If the prefixed text was intended to bind a value, changing the template to bracket syntax addresses the underlying issue.
Quick Recap
Rank #4
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




