angular/angular.js — pull request #8233 by thenikso (2014-07-17 10:09:56+00:00)
Title: fix($location): consider baseHref in realtive link for legacy browsers

I've been having an issue with relative links and html5 mode fallback in IE9 when a `` was provided.

In my case I had:

- `$locationProvider.html5Mode(true).hashPrefix('!');` in my app configuration;
- `` in my headers;
- `` in links.

When clicking a link it is currently rewritten as:
`http://host/en/#!/en/somepage`
which would not match any route as they are defined without the base href (ie `.when("/somepage", ...)`).

With this PR it becomes:
`http://host/en/#!/somepage`
which is what I'd expect in the case described above.

I couldn't yet devise any test for covering this case. This fix concern a click handler on the `$rootElement` which (afaik) is not covered in the current tests.

Please let me know if you find it reasonable and if you have ideas on how to test for it.
Thanks!