$location.url()

url([url]);

This method is getter / setter.

Return url (e.g. /path?a=b#hash) when called without any parameter.

Change path, search and hash, when called with parameter and return $location.

// given url http://example.com/#/some/path?foo=bar&baz=xoxo
var url = $location.url();
// => "/some/path?foo=bar&baz=xoxo"

Parameters

Param Type Details
url
(optional)
string

New url without base prefix (e.g. /path?a=b#hash)

Returns

string

url

doc_AngularJS
2016-03-29 16:10:30
Comments
Leave a Comment

Please login to continue.