title: angular2 Uncaught SyntaxError when accessing through dns and https
body: <p>I have no idea why this problem happens. the site is written in angular2 typescript, and compiling with angular-cli.</p>
  
  <p>when I upload the compiled app to the remote server and accessing the site through <strong>static IP</strong> or <strong>DNS without https</strong> all works fine. but when I try to access through the <strong>DNS and https</strong> which points to the same IP I get a screen with: "loading.." and in the console:
  <strong>"Uncaught SyntaxError: Invalid or unexpected token"</strong> - authentication.service.ts:29 but the service is totally fine.</p>
  
  <h1>the app is live at:</h1>
  
  <p><a href="https://etype-solutions.com/" rel="nofollow noreferrer">https://etype-solutions.com/</a> or <a href="https://81.199.117.250/" rel="nofollow noreferrer">https://81.199.117.250/</a></p>
  
  <h1>versions:</h1>
  
  <pre><code>os: ubuntu 16.04 LTS / Windows 10 x64
  browser: chrome v55
  angular-cli: 1.0.0-beta.26
  node: 6.9.4
  npm: 3.10.10
  typescript: 2.0.10
  angular2: 2.3.1
  </code></pre>