forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.service.$location.html
44 lines (43 loc) · 1.57 KB
/
angular.service.$location.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<h1><tt>angular.service.$location</tt></h1>
<fieldset class="workInProgress">
<legend>Work In Progress</legend>
This page is currently being revised. It might be incomplete or contain inaccuracies.
</fieldset>
<h2>Description</h2>
<p>Parses the browser location url and makes it available to your application.
Any changes to the url are reflected into $location service and changes to
$location are reflected to url.
Notice that using browser's forward/back buttons changes the $location.</p>
<h2>Dependencies</h2>
<ul>
<li><tt>$browser</tt></li>
</ul>
<h2>Methods</h2>
<ul>
<li><tt>$location#update</tt>: <p>Update location object
Does not immediately update the browser
Browser is updated at the end of $eval()</p></li>
<li><tt>$location#updateHash</tt>: <p>Update location hash part</p></li>
<li><tt>$location#toString</tt>: <p>Returns string representation - href</p></li>
</ul>
<h2>Properties</h2>
<ul>
<li><tt>href:string</tt></li>
<li><tt>protocol:string</tt></li>
<li><tt>host:string</tt></li>
<li><tt>port:number</tt></li>
<li><tt>path:string</tt></li>
<li><tt>search:Object.<string|boolean></tt></li>
<li><tt>hash:string</tt></li>
<li><tt>hashPath:string</tt></li>
<li><tt>hashSearch:Object.<string|boolean></tt></li>
</ul>
<h2>Example</h2>
<doc:example>
<doc:source>
<a href="#">clear hash</a> |
<a href="#myPath?name=misko">test hash</a><br/>
<input type='text' name="$location.hash"/>
<pre>$location = {{$location}}</pre>
</doc:source>
</doc:example>