title: How to get the host in angular2
body: <p>I'm looking for a way to get the host of the current URL using Angular2.
  So on </p>
  
  <pre><code> http://example.com/myapp.html
  </code></pre>
  
  <p>I want to get: </p>
  
  <pre><code> example.com
  </code></pre>
  
  <p>(in angular1 I used $location.host() to parse it out. Is there something similar?)</p>