Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!