Given the template for our url /foo
the HTML contains the following:
<a href="#bar" ng-click="myfunc()">Hello</a>
My expectation is that this would direct me to /foo#bar
. Instead, it leads me to /foo#/bar
, which is a problem because I need to use the value bar. Right now I am forcibly removing the slash to get the value bar, but it's awfully hacky.
I am aware this is due to $location and angularjs's routing mechanism. The following link gives a solution which would normally clear this up: AngularJS 1.1.5 - automatically adding hash tag to URLs.
However, enabling html5mode screws up the rest of our links, as it seems to assume we're using a single-page app, while we really aren't. In fact, we aren't even doing routing through angularjs.
All I'm looking for is a way to remove the slash from the location's hash. Is there a simpler solution to this issue?
Note: Bar may be the name of a tab within a page, or it may be a div you can scroll to. I'd prefer to keep it as a simple "#" syntax for clarity to others working on the project.