Wie verwende ich $location zu bekommen, das Protokoll, host und port von meinem aktuellen url in einer Fabrik

Wie bekomme ich das aktuelle Protokoll, host und port, auf meine aktuelle url?

app.factory('actionTypeFactory', ['$resource', function($resource, $location){
  return $resource($location.protocol() + '://'+ $location.host() +':'+  $location.port()  +'82/somelocation')
}]);

Möchte ich die url wie folgt Aussehen:
http://localhost:80 /somelocation

Ich erhalte den Fehler " TypeError: Cannot read property 'Protokoll' undefined
bitte aktualisieren Sie dies, da dies helfen wird, andere suchen nach Antworten. Dank

InformationsquelleAutor Amanda Watson | 2014-08-08

Schreibe einen Kommentar