p-image: Fix inline style not compliant with Strict CSP policy #15993
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
When using the p-image component, there is a hardcoded inline style using style attribute.
If the project is using Strict Content-Security-Policy, this leads to an error.
Environment
.
Reproducer
No response
Angular version
17.3.10
PrimeNG version
17.18.3
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
v20.5.1
Browser(s)
No response
Steps to reproduce the behavior
Note that
writeDirectStyle()
is a function from Angular Core that set thestyle
attribute to an HTML element.Right after the following breakpoint is when the error is raised:
Solution
Move the hardcoded style to
ngStyle
attribute, in the same component (image.ts).Expected behavior
No response
The text was updated successfully, but these errors were encountered: