nglHref is a directive to use $location inside a template. this way, it doesn't matter, if you're using the html5Mode or not.
bower install nglHref
Download the Package from https://github.com/Pulpmedia/ngl-href/archive/master.zip
- Include the libraries
<script src="https://code.angularjs.org/1.3.4/angular.js"></script>
<script src="nglHref/dist/ngl-href.min.js"></script>
- Inject the Module into your application
angular.module('myApp', ['nglHref']);
- Use the directive in your html
<a ngl-href="/home"></a>
results in
<a href="/home"></a>
clicking the link will trigger $location.path()
instead, wich makes it independent from the environment.