I have a script that calls a JS file to display some contents and it works only when the page is reloaded, I mean, when I switch between the different pages that I have in my app, I can't see the contents only unless I reload the whole page - that is when it appears again.
I tried to call the script whenever the user switches between the pages but it didn't work.
The easiest way is to reload the page in background.
This is the function that I want to be called
loadMyScript(event) {
this.loadJsFile('myScript.js');
}
How can I execute the JS or load the page in background with Angular 5?