How can I insert a custom js file in index.html? Always get error 404 https://i.sstatic.net/e6EWe.png
But if add custom.js works well https://i.sstatic.net/QWsPv.png
I can't use node_modules because is very personal js (edited by me) Thanks!
How can I insert a custom js file in index.html? Always get error 404 https://i.sstatic.net/e6EWe.png
But if add custom.js works well https://i.sstatic.net/QWsPv.png
I can't use node_modules because is very personal js (edited by me) Thanks!
Add external JS files:
If you want include any js library in your angular application
add them in scripts array in angular.json respectively .js You can see in build: { } object.
Here is an example of JSON data:
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
...
"scripts": [
"src/assets/js/custom.js"
]
}
}
}
Correct path:
<script src="./assets/vendors/moment/moment-with-locales.min.js"></script>
<link href="./assets/vendors/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css" type="text/css" media="all" rel="stylesheet" />
<script src="./assets/vendors/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>