This diagnostic detects when the .px
, .%
, and .em
suffixes are used with an attribute binding. These suffixes are only available for style bindings.
<div [attr.width.px]="5"></div>
Rather than using the .px
, .%
, or .em
suffixes that are only supported in style bindings, move this to the value assignment of the binding.
<div [attr.width]="'5px'"></div>
This diagnostic can be disabled by editing the project's tsconfig.json
file:
{ "angularCompilerOptions": { "extendedDiagnostics": { "checks": { "suffixNotSupported": "suppress" } } } }
See extended diagnostic configuration for more info.
© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/extended-diagnostics/NG8106