while changing the routes to homepage, javascript and jquery code is not loading in Angular 5
you need to load your script in ngOnInit(). This is because when angular changes its route then it does not fire document.ready. That's why JS does not called. Adding in ngOnInitwill solve the problem. It loads JS when ever your ngOnInit is being called.
ngOnInit(){
$.getScript('src/assets_v2/js/main.js');
// do rest of your stuff here.
}