I'm using links like #!/OrderList?id=123
, which shows the list of all orders and more details of the order 123. With reloadOnSearch=false
and watching $routeUpdate
it works fine, except for one thing: All such links get put into the browsers history, while I'd prefer to have only one such link there. For example, instead of
#!/OrderList?id=123
#!/OrderList?id=124
#!/OrderList?id=125
#!/AnotherList?id=678
#!/AnotherList?id=679
just the last member of each group, i.e.,
#!/OrderList?id=125
#!/AnotherList?id=679
I'm aware of $location.replace()
, but I can't see where to place it when the change happens via following a link. I tried to place it in $scope.$on("$routeUpdate", ...)
, but it did nothing, probably because it's too late when the route has already changed.
I'm not using neither router-ui
nor the HTML5 mode (just plain angular-route
).
I'm afraid, I wasn't clear about me insisting on using href
rather than a custom handler. I want the links to work with middle mouse click and bookmarks and everything. A combination of ng-href
and ng-click
might do what I want, but I've found a simple solution working with plain links.