# `$anchorScroll` (service in module `ng` )

Improve this doc

## Description

When called, it checks current value of `$location.hash()` and scroll to related element, according to rules specified in Html5 spec.

It also watches the `$location.hash()` and scroll whenever it changes to match any anchor. This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`.

## Dependencies

- `$window`
- `$location`
- `$rootScope`

## Usage

    $anchorScroll();