title: Call Javascript function in index HTML from angular 6 component
body: <p>I have a script in my index.html that needs to be called on the component load. </p>
  
  <p>If I refresh the page completely, the script is called and my map API component shows. </p>
  
  <p>If I go from component to component or page to page through my SPA, the script does not load the map at all, and needs a full page refresh in order to do so.</p>
  
  <p>Here is the script:</p>
  
  <pre><code>&lt;script&gt;function(){var a=document.createElement("script");a.type="text/javascript";a.async=!0;a.src="https://cdn.stor....&lt;/script
  </code></pre>
  
  <p>(I left some out but that is the beginning of the script and it is placed right before closing body tag). </p>
  
  <p>How could I call that function from my angular 6 component on init? or after init?</p>