我在IntelliJ和Play Framework中創建了一個Angular2應用程序。下面的代碼是給錯誤system.import腳本沒有在Angular中執行
<script>
System.import('assets/app/main.js').catch(function(err){ console.error(err); });
</script>
錯誤: Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-ol8t6QICwIETK9dhrEwBShFCgKGwmDHZW/nmyLH+rYs='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
仍然是同樣的錯誤 - 錯誤:拒絕評估字符串爲JavaScript,因爲'unsafe-eval'不是下面內容安全策略指令允許的腳本源:「default-src'self'」。 實例化http:// localhost:9000/assets/app/main.js' –