angular/aio/content/extended-diagnostics/NG8106.md
Simona Cotin 5a886c0308 docs(extended-diagnostics): fix code example (#48963)
Update code examples to use < and &gt for html elements
PR Close #48963
2023-02-06 12:31:33 -08:00

1.1 KiB

@name Suffix not supported

@description

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>

What should I do instead?

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>

What if I can't avoid this?

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.

@reviewed 2022-02-28