I'm building an application on Angular 8 and in one of my components I whish to include drag.js which contains the following code:
window.addEventListener("load", () => {
doStuff();
})
I've added drag.js to my scripts secction in angular.json
"scripts": [ "src/assets/scripts/drag.js" ]
And have imported it in Angular view such as:
<script src="assets/scripts/drag.js"></script>
The problem here is the file isn't served and no code runs when the page loads. Maybe this is not possible. Any help here?