Is there a way to return the full url representation with all segments encoded using Angular 2?
According to the Angular 1 Documentation, $location.absUrl(); will return it as such.
https://docs.angularjs.org/api/ng/service/$location
Methods absUrl(); This method is getter only.
Return full url representation with all segments encoded according to rules specified in RFC 3986.
// given url http://example.com/#/some/path?foo=bar&baz=xoxo var absUrl = $location.absUrl(); // => "http://example.com/#/some/path?foo=bar&baz=xoxo"