Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

182
Vistas
Angular - opening a modal causes" Content Security Policy (script-src 'self') Error"

I am working on an Angular project and I am running into an issue where clicking a link to open a modal causes the following error:

Refused to run /cards:1 the JavaScript URL because it violates the following Content Security Policy directive: "Script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-....'), or a none ('nonce-...') is required to enable inline execution.

I am confused by this error because there are multiple other locations in the code where clicking a button/dropdown/etc causes a modal to open, but it does not throw the same error. I also imagine the script is coming from the application itself. Could the 'a' tag be the problem? Also the mentioning of "/cards:1" is interesting because that is not the component itself, but the parent component.

The code with the link/modal:

<error-badge>
   <error-item>
     <span>{{ text }}</span>
     <div>
        <a href="javascript:void(0)" (click)="openModal()">
          {{ linkText }}}
        </a>
     </div>
   </error-item>
</error-badge>

<modal [(modalOpen)]="modalOpen">
   {{ modalText }}}
</modal>
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda