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

docs($location): add note about breaking anchor links #8660

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/content/guide/$location.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,12 @@ can recognize the crawler and serve a HTML snapshots. For more information about
see [Making AJAX Applications
Crawlable](http://code.google.com/web/ajaxcrawling/docs/specification.html).

## Injecting $location and anchor links

Injecting `$location` anywhere in the app, if html5mode is not enabled, may lead
to the Angular breaking anchor links. Specifically, Angular will rewrite the
url by adding a `/` after the hash, which breaks anchor scrolling and may cause
functionality issues on applications where `$location` does not control routing.

# Testing with the $location service

Expand Down