title: How do I use $location to to get the protocol host and port of my current url in a factory
body: <p>How do I get the current protocol host and port of my current url?</p>
  
  <pre><code>app.factory('actionTypeFactory', ['$resource', function($resource, $location){
    return $resource($location.protocol() + '://'+ $location.host() +':'+  $location.port()  +'82/somelocation')
  }]);
  </code></pre>
  
  <p>I would like the url to look like this:
     http:// localhost:80 /somelocation</p>