I have a navbar on my Angular 7 application. I also have a custom javascript file that loads when the app initially load. After clicking on a link in my application to route to another component, the external javascript file stops working/does not load. How can I get this javascript file to load or remain loaded when I click on a link to route to a different component?
I have added the javascript file to my angular.json file correctly, the problem still persists. I have tried loading the script inside of my index.html file inside a script tag, that also does not solve my problem.
I've read through some older stackoverflow threads regarding the same problem but there doesn't seem to be a definitive answer or solution.
I expect my custom js file to load with all of its functionality after clicking on a link in my navbar to that routes me to another component but it does not load with any functionality.