1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular gives `Refused to execute inline event handler` error

Discussão em 'Angular' iniciado por Jeanluca Scaljeri, Novembro 24, 2025.

  1. I have created an angular application. which gives the following error in the browser

    [​IMG]

    Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.


    It only occurs when "optimization" is set to true inside angular.sjon. So I can fix this error easily, but it doesn't feel as the right solution. Is there a better solution for this issue?

    Continue reading...

Compartilhe esta Página