Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit a5cfa88

Browse files
committed
docs(guide/Using Location): change / remove obsolete information
1 parent bbf74f9 commit a5cfa88

File tree

1 file changed

+6
-90
lines changed

1 file changed

+6
-90
lines changed

docs/content/guide/$location.ngdoc

+6-90
Original file line numberDiff line numberDiff line change
@@ -748,18 +748,13 @@ Note that the `!` prefix in the hashbang mode is not part of `$location.path()`;
748748

749749
### Crawling your app
750750

751-
To allow indexing of your AJAX application, you have to add special meta tag in the head section of
752-
your document:
753-
754-
```html
755-
<meta name="fragment" content="!" />
756-
```
757-
758-
This will cause crawler bot to request links with `_escaped_fragment_` param so that your server
759-
can recognize the crawler and serve a HTML snapshots. For more information about this technique,
760-
see [Making AJAX Applications
761-
Crawlable](http://code.google.com/web/ajaxcrawling/docs/specification.html).
751+
Most modern search engines are able to crawl AJAX applications with dynamic content, provided all
752+
included resources are available to the crawler bots.
762753

754+
There also exists a special
755+
[AJAX crawling scheme](http://code.google.com/web/ajaxcrawling/docs/specification.html) developed by
756+
Google that allows bots to crawl the static equivalent of a dynamically generated page,
757+
but this schema has been deprecated, and support for it may vary by search engine.
763758

764759
## Testing with the $location service
765760

@@ -784,85 +779,6 @@ describe('serviceUnderTest', function() {
784779
});
785780
```
786781

787-
788-
## Migrating from earlier AngularJS releases
789-
790-
In earlier releases of AngularJS, `$location` used `hashPath` or `hashSearch` to process path and
791-
search methods. With this release, the `$location` service processes path and search methods and
792-
then uses the information it obtains to compose hashbang URLs (such as
793-
`http://server.com/#!/path?search=a`), when necessary.
794-
795-
### Changes to your code
796-
797-
<table class="table">
798-
<thead>
799-
<tr class="head">
800-
<th>Navigation inside the app</th>
801-
<th>Change to</th>
802-
</tr>
803-
</thead>
804-
805-
<tbody>
806-
<tr>
807-
<td>$location.href = value<br />$location.hash = value<br />$location.update(value)<br
808-
/>$location.updateHash(value)</td>
809-
<td>$location.path(path).search(search)</td>
810-
</tr>
811-
812-
<tr>
813-
<td>$location.hashPath = path</td>
814-
<td>$location.path(path)</td>
815-
</tr>
816-
817-
<tr>
818-
<td>$location.hashSearch = search</td>
819-
<td>$location.search(search)</td>
820-
</tr>
821-
822-
<tr class="head">
823-
<th>Navigation outside the app</td>
824-
<th>Use lower level API</td>
825-
</tr>
826-
827-
<tr>
828-
<td>$location.href = value<br />$location.update(value)</td>
829-
<td>$window.location.href = value</td>
830-
</tr>
831-
832-
<tr>
833-
<td>$location[protocol | host | port | path | search]</td>
834-
<td>$window.location[protocol | host | port | path | search]</td>
835-
</tr>
836-
837-
<tr class="head">
838-
<th>Read access</td>
839-
<th>Change to</td>
840-
</tr>
841-
842-
<tr>
843-
<td>$location.hashPath</td>
844-
<td>$location.path()</td>
845-
</tr>
846-
847-
<tr>
848-
<td>$location.hashSearch</td>
849-
<td>$location.search()</td>
850-
</tr>
851-
852-
<tr>
853-
<td>$location.href<br />$location.protocol<br />$location.host<br />$location.port<br
854-
/>$location.hash</td>
855-
<td>$location.absUrl()<br />$location.protocol()<br />$location.host()<br />$location.port()<br
856-
/>$location.path() + $location.search()</td>
857-
</tr>
858-
859-
<tr>
860-
<td>$location.path<br />$location.search</td>
861-
<td>$window.location.path<br />$window.location.search</td>
862-
</tr>
863-
</tbody>
864-
</table>
865-
866782
## Two-way binding to $location
867783

868784
Because `$location` uses getters/setters, you can use `ng-model-options="{ getterSetter: true }"`

0 commit comments

Comments
 (0)