docs($injector): fix syntax error

There was a missing parenthesis in $injector test example

Closes #9469
fix($browser): Cache `location.href` only during page reload phase

Adds caching for url changes while a reload is happening,
as browsers do not allow to read out the new location the browser
is navigating to.

Removes unnecessary caching from $browser, as IE7-IE9 all
have the new hash value in `location.href` after changing it.
There was a wrong assumption in the previous version of this code
introduced by dca23173e25a32cb740245ca7f7b01a84805f43f and d70711481e6311c9cd283d650f07ca0cca72ecc2.

Adds more tests for #6976
Fixes #9235
Closes #9455
feat($location): add support for History API state handling

Adds $location state method allowing to get/set a History API state via
pushState & replaceState methods.

Note that:
- Angular treats states undefined and null as the same; trying to change
one to the other without touching the URL won't do anything. This is necessary
to prevent infinite digest loops when setting the URL to itself in IE<10 in
the HTML5 hash fallback mode.
- The state() method is not compatible with browsers not supporting
the HTML5 History API, e.g. IE 9 or Android < 4.0.

Closes #9027
refactor: use document.documentMode to determine msie version

Closes #9398
fix($animate): ensure that class-based animations only consider the most recent DOM operations

Prior to this fix $animate would maintain a count of each time a class was
added and removed within $animate. With this fix, $animate instead only cares
about the most recent addClass or removeClass operation and will only perform
that operation (depending on what was last called).

```
// before
addClass    => +1
removeClass => 0
addClass    => +1
addClass    => +2
removeClass => +1
// this will cause an addClass animation

// now
addClass    => add
removeClass => remove
addClass    => add
addClass    => add
removeClass => remove
// this will cause a removeClass animation
```

Closes #8946
Closes #9458
chore(ngScenario): make jshint happy

Someone accidentally removed an important keyword which prevented a variable from being added to the global object

Closes #9484
Merge branch 'master' of https://github.com/angular/angular.js into add-offset-to-$anchorScroll
fix($anchorScroll): make sure scrolling takes place when `readyState ===
'complete'`

When navigating to a page with a hash in the URL, Firefox and IE do their
native scrolling AFTER $anchorScroll, which cancels the applied `yOffset`.
Waiting for `document.readyState` to be 'complete' solves the problem in
Firefox.
(In IE, the issue still appears when navigating to a URL (with a hash),
but not when reloading the same URL.)

Note, that with or without this fix subsequent calls to `$anchorScroll()`
or changes to `$location.hash()` work as expected in all supported
browsers.