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>