There is a workaround for AngularJS 1.1.5 - automatically adding a hash tag to URLs
The answer explains the first step (as explained above, with the addition of a new hash prefix)
yourApp.config(['$locationProvider', function($locationProvider){ $locationProvider.html5Mode(true).hashPrefix('!'); }]);
The first bit handles Angular visually visually, but clicking on any links does not work properly (read: history.pushState )
So, a workaround, as @Kevin Beal pointed out, is some variation of the target setting from <a> to _self
$('a[href]').attr({'target':'_self'})
or in each case:
<a href="foo" target="_self">Foo</a> <a href="http://some.external/bar" target="_blank">Bar</a>
Although, for convenience and sanity, I think this is a combination of them.
Markup without target
<a href="foo">Foo</a> <a href="http://some.external/bar">Bar</a>
Js
// If `http` protocol present, assume external link $('a[href^="http://"]').attr({'target':'_blank'}); // Otherwise, assume internal link $('a:not([href^="http://"])').attr({'target':'_self'});
It is worth noting that the above selectors really require jQuery itself.
source share