$location.hash()

hash([hash]);

This method is getter / setter.

Returns the hash fragment when called without any parameters.

Changes the hash fragment when called with a parameter and returns $location.

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

Parameters

Param Type Details
hash
(optional)
stringnumber

New hash fragment

Returns

string

hash

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

Please login to continue.