title: Angular 5 include javascript files
body: <p>I'm using Angular 5 and I want to include my script files .js</p>
  
  <p>I'm using the script tag in the index.html</p>
  
  <p>When I refresh the page everything works fine, but when i'm using SPA routing my js files does not included</p>
  
  <p>Here's an exemple :</p>
  
  <p>If I refreshed the page</p>
  
  <p><a href="https://i.stack.imgur.com/t3O2H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t3O2H.png" alt="enter image description here"></a></p>
  
  <p>When i'm using SPA navigation</p>
  
  <p><a href="https://i.stack.imgur.com/ZFcJ6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZFcJ6.png" alt="enter image description here"></a></p>
  
  <p>Here's <strong>index.html</strong> where i include all my script whith <strong>script</strong> tag</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;base href="/"&gt;
      &lt;title&gt;Listeo&lt;/title&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;link rel="icon" type="image/x-icon" href="favicon.ico"&gt;
      &lt;link rel="stylesheet" href="../assets/css/style.css"&gt;
      &lt;link rel="stylesheet" href="../assets/css/colors/main.css" id="colors"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;app-base&gt;&lt;/app-base&gt;
      &lt;script type="text/javascript" src="../assets/scripts/jquery-2.2.0.min.js"&gt;&lt;/script&gt; 
      &lt;script type="text/javascript" src="../assets/scripts/mmenu.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../assets/scripts/chosen.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../assets/scripts/slick.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../assets/scripts/rangeslider.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../assets/scripts/magnific-popup.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../assets/scripts/waypoints.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../assets/scripts/counterup.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../assets/scripts/jquery-ui.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../assets/scripts/tooltips.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../assets/scripts/custom.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../assets/scripts/switcher.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and here's the navigation bar :</p>
  
  <pre><code>&lt;nav id="navigation" class="style-1"&gt;
      &lt;ul id="responsive"&gt;
          &lt;li&gt;
              &lt;a [routerLink]="['home']" [routerLinkActive]="['current']"&gt;Home&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;a [routerLink]="['restaurants']" [routerLinkActive]="['current']"&gt;Restaurants&lt;/a&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>When I'm using the <strong>href</strong> everything wirks fine, but with <strong>[routerLink]</strong> I'm facing the problem.</p>