path([path]);
This method is getter / setter.
Return path of current url when called without any parameter.
Change path when called with parameter and return $location
.
Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing.
// given url http://example.com/#/some/path?foo=bar&baz=xoxo var path = $location.path(); // => "/some/path"
Parameters
Param | Type | Details |
---|---|---|
path (optional) | string number | New path |
Returns
string |
path |
Please login to continue.