I have an element in an Angular2 app that loads fine when I refresh the page or go to it initially, but is hidden when I change the route to the parent page. I am using some purchased styles/js and when I searched the element name I found some functions inside of a .ready() call that show the element and adjust its height. I believe the issue is that these init scripts run the first time, but then when I change routes they do not execute. I need these scripts throughout the website and I can't really split them up because they're minified. I tried just popping all the scripts into the bottom of the component's HTML but this did not work (not that I expected it to).
If this isn't enough info I can pastebin the js and the element in question but this seems to me like something that would come up a lot and therefore have an easy, generic fix.
this.router.events.subscribe((evt) => { if (evt instanceof ResolveStart && this.router.url !== '/home' && evt.url == '/home' && this.router.url !== '/' && this.router.url !== evt.url){ window.location.href = window.location.origin; }})