title: How to call external javascript function in angular 5?
body: <p>I have downloaded a theme from <a href="http://demo.themewagon.com/preview/free-multi-page-html5-portfolio-template-free-download" rel="nofollow noreferrer">this</a> link. I have to define script and CSS in index.html file.</p>
  
  <p>index.html (body section)</p>
  
  <pre><code>&lt;body&gt;
    &lt;app-root&gt;&lt;/app-root&gt;
    &lt;script type="text/javascript" src="./assets/js/main.85741bff.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="./assets/js/common.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I have defind my function in common.js and call it from main.85741bff.js file.</p>
  
  <p>common.js (function)</p>
  
  <pre><code>document.addEventListener("DOMContentLoaded", function (event) {
       masonryBuild();
       navbarToggleSidebar();
       navActivePage();
  });
  </code></pre>
  
  <p>The issue is that I am able to call the function while page reloads but can't call the function while content load.</p>
  
  <p>Can anyone help me to resolve this issue? Any help would be appreciated.</p>