title: External Javascript is not working on first load in angular
body: <p>I just start working on Angular 4. My client gives me web template and asks me to convert it to Angular 4 project.
  The template has many JS and CSS file, so I include all JS and CSS that I need in index.html. BUT, the JS is not working on first load and need to refresh the page to get it work. Also, after refresh when i move to other routes the JS not working again.</p>
  
  <p>I have filter some unused JS and remove it, i think if there is wrong or miss JS to include it will be show an error. But no error just need to refresh.</p>
  
  <p>this is my index.html</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;Ui&lt;/title&gt;
    &lt;base href="/"&gt;
  
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
     &lt;link rel="shortcut icon" href="assets/global/images/favicon.png" type="image/png"&gt;
    &lt;link rel="icon" type="image/x-icon" href="favicon.ico"&gt;
    &lt;link rel="shortcut icon" href="assets/global/images/favicon.png" type="image/png"&gt;
    &lt;link href="assets/global/plugins/datatables/dataTables.min.css" rel="stylesheet"&gt;
      &lt;!-- END PAGE STYLE --&gt;
      &lt;link href="assets/global/css/style.css" rel="stylesheet"&gt;
      &lt;link href="assets/global/css/theme.css" rel="stylesheet"&gt;
      &lt;link href="assets/global/css/ui.css" rel="stylesheet"&gt;
      &lt;link href="assets/admin/md-layout1/material-design/css/material.css" rel="stylesheet"&gt;
      &lt;link href="assets/admin/md-layout1/css/layout.css" rel="stylesheet"&gt;
      &lt;script src="assets/global/plugins/modernizr/modernizr-2.6.2-respond-1.1.0.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body class="sidebar-condensed fixed-topbar fixed-sidebar theme-sdtl account separate-inputs dashboard" data-page="login"&gt;
    &lt;app-root&gt;&lt;/app-root&gt;
      &lt;script src="assets/global/plugins/jquery/jquery-3.1.0.min.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/plugins/jquery/jquery-migrate-3.0.0.min.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/plugins/jquery-ui/jquery-ui.min.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/plugins/bootstrap/js/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/plugins/appear/jquery.appear.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/plugins/jquery-cookies/jquery.cookies.min.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/plugins/mcustom-scrollbar/jquery.mCustomScrollbar.concat.min.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/plugins/bootstrap-dropdown/bootstrap-hover-dropdown.min.js"&gt;&lt;/script&gt; &lt;!-- Show Dropdown on Mouseover --&gt;
      &lt;script src="assets/global/plugins/select2/dist/js/select2.full.min.js"&gt;&lt;/script&gt; &lt;!-- Select Inputs --&gt;
      &lt;script src="assets/global/plugins/icheck/icheck.min.js"&gt;&lt;/script&gt; &lt;!-- Checkbox &amp; Radio Inputs --&gt;
      &lt;script src="assets/global/plugins/bootstrap-progressbar/bootstrap-progressbar.min.js"&gt;&lt;/script&gt; &lt;!-- Animated Progress Bar --&gt;
      &lt;script src="assets/global/js/builder.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/js/application.js"&gt;&lt;/script&gt; &lt;!-- Main Application Script --&gt;
      &lt;script src="assets/global/js/plugins.js"&gt;&lt;/script&gt; &lt;!-- Main Plugin Initialization Script --&gt;
      &lt;script src="assets/global/plugins/noty/jquery.noty.packaged.min.js"&gt;&lt;/script&gt;  &lt;!-- Notifications --&gt;
      &lt;script src="assets/global/plugins/charts-highstock/js/highstock.js"&gt;&lt;/script&gt; &lt;!-- financial Charts --&gt;
      &lt;script src="assets/global/js/pages/dashboard.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/plugins/bootstrap-loading/lada.min.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/js/pages/login-v1.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/plugins/datatables/jquery.dataTables.min.js"&gt;&lt;/script&gt; &lt;!-- Tables Filtering, Sorting &amp; Editing --&gt;
      &lt;script src="assets/global/plugins/datatables/dataTables.bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;script src="assets/global/js/pages/table_dynamic.js"&gt;&lt;/script&gt;
      &lt;script src="assets/admin/md-layout1/material-design/js/material.js"&gt;&lt;/script&gt;
      &lt;script src="assets/admin/layout.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>NOTE: I didn't add anything in .angular.cli.json, i have tried it and still the same.</p>