$location.replace()

replace(); If called, all changes to $location during the current $digest will replace the current history record, instead of adding a new one.

$location.protocol()

protocol(); This method is getter only. Return protocol of current url. // given url http://example.com/#/some/path?foo=bar&baz=xoxo var protocol = $location.protocol(); // => "http" Returns string protocol of current url

$location.port()

port(); This method is getter only. Return port of current url. // given url http://example.com/#/some/path?foo=bar&baz=xoxo var port = $location.port(); // => 80 Returns Number port

$location.path()

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) stringnumber New path Returns string path

$location.host()

host(); This method is getter only. Return host of current url. Note: compared to the non-angular version location.host which returns hostname:port, this returns the hostname portion only. // given url http://example.com/#/some/path?foo=bar&baz=xoxo var host = $location.host(); // => "example.com" // given url http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo host = $location.host(); // => "example.com" host = location.host; // => "example.com:8080" Returns

$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

$location.absUrl()

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" Returns string full url

$location.$locationChangeSuccess

$locationChangeSuccess Broadcasted after a URL was changed. The newState and oldState parameters may be defined only in HTML5 mode and when the browser supports the HTML5 History API. Type: broadcast Target: root scope Parameters Param Type Details angularEvent Object Synthetic event object. newUrl string New URL oldUrl (optional) string URL that was before it was changed. newState (optional) string New history state object oldState (optional) string History s

$location.$locationChangeStart

$locationChangeStart Broadcasted before a URL will change. This change can be prevented by calling preventDefault method of the event. See $rootScope.Scope for more details about event object. Upon successful change $locationChangeSuccess is fired. The newState and oldState parameters may be defined only in HTML5 mode and when the browser supports the HTML5 History API. Type: broadcast Target: root scope Parameters Param Type Details angularEvent Object Synthetic event object. newU

$locale

service in module ng $locale service provides localization rules for various Angular components. As of right now the only public api is: id â {string} â locale id formatted as languageId-countryId (e.g. en-us)